You work as the Enterprise application developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. All servers in the domain run Windows Server 2003. The design of applications forms part of your responsibilities at Domain.com. Domain.com operates as the local municipal traffic authority in Miami. You have been instructed to develop an enterprise application for Domain.com. Following is a list of all the requirements that you should keep in mind when you develop the application:
1. In the event of a driver exceeding the speed limit by more than 10 and less than 20 kilometers per hour (KPH) – the corresponding fine should be $100 with an additional amount of $10 for each KPH over the limit.
2. In the event of a driver exceeding the speed limit by 20 or more KPH, the corresponding fine should be $250 with an additional $25 for each KPH over the limit.
To this end you write the following pseudo-code to address the requirements:
DECLARE speedLimit INTEGER
DECLARE speed INTEGER
DECLARE fine INTEGER
Now you need to complete the pseudo-code.
What should you do? (Choose the correct code segment.)
A.
IF speed > 10 THEN
fine = 100 + 10 * (speed – speed limit)
IF speed > 20 THEN
fine = 250 + 25 * (speed – speed limit)
B.
IF speed > 20 THEN
fine = 250 + 25 * (speed – speed limit)
IF speed > 10 THEN
fine = 100 + 10 * (speed – speed limit)
C.
IF speed- speed limit> 20 THEN
fine = 250 + 25 * (speed – speed limit)
ELSE IF speed – speed limit > 10 THEN
fine = 100 + 10 * (speed – speed limit)
D.
IF speed > 10 THEN
fine = 100 + 10 * (speed – speed limit)
ELSE IF speed > 20 THEN
fine = 250 + 25 * (speed – speed limit)