Question: Task: 1. Create C program to calculate the price for the petrol purchased. The program prompt user to select type of the petrol and inputs
Task:
1. Create C program to calculate the price for the petrol purchased. The program prompt user to select type of the petrol and inputs petrol in liters and then calculates the price of the petrol. Table below shows the price per liter for each type of the petrol.
Table 1: Petrol price per liter
| Type | Price per liter |
| RON 95 | RM2.03 |
| RON 97 | RM2.58 |
2.Output should displays the price before and after the rounding adjustment. The price must be rounded using RM rounding mechanism as shown in Table 2.
Table 2: RM Rounding Mechanism
| Bill ends in cent | Amount before rounding | Amount after rounding |
| 1,2 | 82.01 82.02 | 82.00 |
| 3,4 | 82.03 82.04 | 82.05 |
| 5,6 | 82.05 82.06 | 82.05 |
| 7,8 | 82.07 82.08 | 82.10 |
| 9,10 | 82.09 82.10 | 82.10 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
