1. Create C program to calculate the price for the petrol purchased. The program prompt user...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
C program to print price of petrol using RM rounding mechanism Code include include int main declari... View the full answer
Related Book For
John E Freunds Mathematical Statistics with Applications
ISBN: 978-0134995373
8th edition
Authors: Irwin Miller, Marylees Miller
Posted Date:
Students also viewed these finance questions
-
Design a circuit that receives 1,000 32-bit integers serially (one integer per cycle), bin them into four bins based on their values, and compute the binning statistics: 1) How many integers in bin 1...
-
(a) Use a computer program to calculate the probability that more than 12 of 80 business telephone calls last longer than five minutes if it is assumed that 10 percent of such calls last that long....
-
Using RECURSION, write a cpp program to calculate the factorial of a number.
-
In contrast to our analysis in Section 5.4.3, Carlton and Loury (1980) suggest that a Pigouvian tax alone will not lead to a long run social optimum for competitive polluting firms. Using their...
-
What and where is the Microsoft Office button and what is the backstage view?
-
Evaluate (g(t)) using the Chain Rule: r(t)=(e, est,-9), g(t) = 8t+2 (9(t))=000
-
Three different instrument panel configurations were tested by placing airline pilots in flight simulators and testing their reaction time to simulated flight emergencies. Eight pilots were assigned...
-
Recall that in Consulting Opportunity 3.1, The Sweetest Sound Ive Ever Sipped, you met Felix Straw. Devise a systems solution that will address the problems discussed there. Your solution should...
-
A bond is currently selling in the market for $1,085.96. It has a coupon of 8% and a 15-year maturity. Using annual compounding, what is the yield to maturity on this bond?
-
The Profit & Gambit Co. has a major product that has been losing money recently because of declining sales. In fact, during the current quarter of the year, sales will be 4 million units below the...
-
The actual cash received from cash sales was $35,440, and the amount indicated by the cash register total was $35,474. Journalize the entry to record the cash receipts and cash sales. If an amount...
-
Which of the following will shift the aggregate supply curve to the right? a. A new networking technology increases productivity all over the economy. b. The price of oil rises substantially. c....
-
Label each of the following descriptions as being either an immediate-short-run aggregate supply curve, a short-run aggregate supply curve, or a long-run aggregate supply curve. b. A vertical line....
-
Which of the following will shift the aggregate demand curve to the left? a. The government reduces personal income taxes. b. Interest rates rise. c. The government raises corporate profit taxes. d....
-
Which of the following help to explain why the aggregate demand curve slopes downward? a. When the domestic price level rises, our goods and services become more expensive to foreigners. b. When...
-
If an economy has an inflationary expenditure gap, the government could attempt to bring the economy back toward the full-employment level of GDP _________ by taxes or ________ government...
-
We can perform logical operations on strings of bits by considering each pair of bits separately (called bitwise operation). (10 points) Given two strings A and B A=10111001 B = 10100101 Perform the...
-
If the jobs displayed in Table 18.24 are processed using the earliestdue-date rule, what would be the lateness of job C? TABLE 18.24 Processing Times and Due Dates for Five Jobs Job C D E...
-
To compare two kinds of front- end designs, six of each kind were installed on a certain make of compact car. Then each car was run into a concrete wall at 5 miles per hour, and the following are the...
-
To illustrate the law of large numbers (see also Exercise 5.54 on page 172), use the normal approximation to the binomial distribution to determine the probabilities that the proportion of heads will...
-
If the joint probability density of X and Y is given by Find (a) The marginal density of X; (b) The marginal density of Y. Also determine whether the two random variables are independent. f(x, y)...
-
Consider a scenario where your laptop has stopped working and you take it to a repair center. The vendor asks for a huge sum of money, but you negotiate with him the price for repair. Create a class...
-
Consider a scenario where you negotiate with a company over the salary and perks being offered for a position. Create a class diagram for this using negotiation patterns as your base and draw a...
-
Consider a scenario where an online trade application is being developed. The two registered users can negotiate over the price of a product being traded. Create a class diagram for this application...
Study smarter with the SolutionInn App