Write a C program using function and a while loop to compute the price of various types of luxury car after a boxing day discount. The price and discount are to accepted from user's entry through keyboard. The detail information is tabulated in Table 1:Luxury Car's Information. Table 1: Luxury Car's Information Option Car Price(RM) Discount (%) 25.0 12.6 Lamborghini Aventador Maserati Quattroporte BMW Z4 Porsche Panamera 2.2 million 950,000.00 300,000.00 740,000.00 1 2 3 10.01 4 34.5 The descriptions of functions are as follows; Function Prototype Description float new_price (float, float); This function receive the original price and discount and return the discounted price This function receives original price, discount rate and the discounted price to be displayed. void display (float,float, float);

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Write a C program using function and a while loop to compute the price of various types of
luxury car after a boxing day discount. The price and discount are to accepted from user's
entry through keyboard. The detail information is tabulated in Table 1:Luxury Car's
Information.
Table 1 : Luxury Car's Information
Option
Car
Discount
(%)
Price(RM)
Lamborghini Aventador
Maserati Quattroporte
1
2.2 million
25.0
950,000.00
300,000.00
2
12.6
3
BMW Z4
10.01
4
Porsche Panamera
740,000.00
34.5
The descriptions of functions are as follows;
Function Prototype
Description
float new_price (float, float); This function receive the original price
and discount and return the discounted
price
This function receives original price,
discount rate and the discounted price
to be displayed.
void
display(float,float,float);
Example of Output:
Enter Option for Car :1
Original Price:RM 22000000.00
Discount: 0.25
Price after discount :RM 5500000.00
More? 'Y' for yes, 'N' for no : Y
Enter Option for Car :2
Original Price:RM 950000.00
Discount: 0.13
Price after discount :RM 119700.00
More? 'Y' for yes, 'N' for no : Y
Enter Option for Car :3
Original Price:RM 300000.00
Discount: 0.10
Price after discount :RM 30030.00
More? 'Y' for yes, 'N' for no : N
Transcribed Image Text:Write a C program using function and a while loop to compute the price of various types of luxury car after a boxing day discount. The price and discount are to accepted from user's entry through keyboard. The detail information is tabulated in Table 1:Luxury Car's Information. Table 1 : Luxury Car's Information Option Car Discount (%) Price(RM) Lamborghini Aventador Maserati Quattroporte 1 2.2 million 25.0 950,000.00 300,000.00 2 12.6 3 BMW Z4 10.01 4 Porsche Panamera 740,000.00 34.5 The descriptions of functions are as follows; Function Prototype Description float new_price (float, float); This function receive the original price and discount and return the discounted price This function receives original price, discount rate and the discounted price to be displayed. void display(float,float,float); Example of Output: Enter Option for Car :1 Original Price:RM 22000000.00 Discount: 0.25 Price after discount :RM 5500000.00 More? 'Y' for yes, 'N' for no : Y Enter Option for Car :2 Original Price:RM 950000.00 Discount: 0.13 Price after discount :RM 119700.00 More? 'Y' for yes, 'N' for no : Y Enter Option for Car :3 Original Price:RM 300000.00 Discount: 0.10 Price after discount :RM 30030.00 More? 'Y' for yes, 'N' for no : N
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY