Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
C program to print price of petrol using RM rounding mechanism Code include include int main declari...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started