Question: 1. Create C program to calculate the price for the petrol purchased. The program prompt user to select type of the petrol and inputs
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 Price per liter RON 95 RM1.25 RON 97 RM1.55 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.00 82 02 3,4 82.03 82.05 82.04 5,6 82.05 82.05 82.08 7,8 82 07 82.10 82.08 9,10 82.09 82.10 82,10
Step by Step Solution
3.39 Rating (149 Votes )
There are 3 Steps involved in it
C program to print price of petrol using RM rounding mechanism Code include include int main declari... View full answer
Get step-by-step solutions from verified subject matter experts
