The decision table below shows fines imposed for speeding violations. Write a code segment that assigns the correct fine to type double variable fine based on the value of type int variable speed.
Speed (mph) Fine ($)
65 or less 0
66-70 15.00
71-75 30.00
76-80 75.00
over 80 100.00
```
if (speed <= 65)
fine = 0;
else if (speed <= 70)
fine = 15.0;
else if (speed <= 75)
fine = 30.0;
else if (speed <= 80)
fine = 75.0;
else
fine = 100.0
```
You might also like to view...
The IF function
A) contains another function embedded inside one or more of its arguments. B) contains data for the basis of the lookup and data to be retrieved. C) evaluates a condition and returns one value if the condition is true and a different value if the condition is false. D) looks up a value and returns a related result from the lookup table.
Encapsulation is not provided by C++'s class capability.
Answer the following statement true (T) or false (F)