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...
-
In general, at what amount are items includible in the gross estate valued? (Answer in words.) Indicate one exception to the general valuation rules and the reason for this exception.
-
Which of the following tells the compiler to merge the code contained in the iostream file with the current files code? a. #include iostream; b. #include c. #include ; d. #include (iostream)
-
Prance Athleticwear Company owns all of the voting stock of Stallion Shoes. Acquisition cost was \($7\) million in excess of Stallions book value of \($3\) million, and the excess was attributed to...
-
XYZ is a calendar-year corporation that began business on January 1, 2020. For the year, it reported the following information in its current-year audited income statement. Notes with important tax...
-
Refer to the picture. 1. Explain what is receivable financing # Your answer 2. What are the forms of financing related to accounts receivable? * Your answer 3. Distinguish pledge from assignment. *...
-
In your opinion, based on the concepts presented within this chapter, what key fundamentals do managers need to understand to successfully manage a business?
-
Give correct answers 1.explain how Legal Feasibility generates sanity in project management 2.is there any details that support theEconomic Feasibility as a milestone in project management? 3.what is...
-
What is SQL?
-
What is the relationship between par rates and spot rates when the yield curve is upward sloping/downward sloping?
-
What is the internal view of a database?
-
Define the term day count basis.
-
What types of problems does data redundancy cause?
-
Question 9 6 pts 0n 1 July 2018 Ma Ltd acquires a 30 per cent interest in Pa Ltd for a cash consideration of $540 000. On the date of the acquisition, the assets of Pa Ltd are reported at fair value...
-
If a force of F = 50 Ib is applied to the pads at A and C, determine the smallest dimension d required for equilibrium if the spring has an unstretched length of 1 ft. B 1 ft 1 ft F k = 15016/fr 1ft...
-
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)...
-
What is meant by refunding?
-
The Merton Manufacturing Co Ltd has been in business for many years making fitted furniture and chairs. During 2004 and 2005 substantial losses have been sustained on the manufacture of chairs and...
-
A company retired a bond issue early, at a loss. Is the company in an economically worse position after the retirement?
Study smarter with the SolutionInn App