As a programmer, you are asked to develop a C program using if...else statements or switch statements and loop where it is appropriate and create a program with the following output (The numbers in bold/underline are user's input). Your program should show an invalid message if product code chosen by users are other than code listed in the table.

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 and draw a flowchart
RH Souvenir Sdn Bhd is a company that sells souvenir products to schools and institutes of
higher learning. The company plans to use the system to facilitate purchases and payments.
So the company wants to hire a programmer to develop a souvenir price calculator program
that reads product code and number of product as inputs and calculate the souvenir price for
the specified purchase according to Table 1. All product's prices are subject to Sales and
Service Tax (SST). Therefore, the total price must include 10% of the SST. Repeat the same
task using repetition structure until user enter “n’ for no. At the end of the program produce
total price, tax amount and price after tax.
Table 1
Product Type Product Code Product Description Price per Product
101
Sport medal
RM 4.50
Metal Craft
102
Кeychain
RM 3.00
201
Sticker
RM 1.50
Gift and Craft
202
Mug
RM 5.20
203
Postcard
RM 1.00
As a programmer, you are asked to develop a C program using if...else statements or switch
statements and loop where it is appropriate and create a program with the following output
(The numbers in bold/underline are user's input). Your program should show an invalid
message if product code chosen by users are other than code listed in the table.
**********MAJUJAYA SOUVENIR CALCULATOR*
Please enter your product code: 202
Please enter the number of products needed: 100
Souvenir price: 520.00
Would you like to buy another product? y
Please enter your product code: 101
Please enter the number of products needed: 173
Souvenir price: 778.50
Would you like to buy another product? n
Total price: 1298.50
Tax amount: 129.85
Price after tax: RM1428.35
Transcribed Image Text:RH Souvenir Sdn Bhd is a company that sells souvenir products to schools and institutes of higher learning. The company plans to use the system to facilitate purchases and payments. So the company wants to hire a programmer to develop a souvenir price calculator program that reads product code and number of product as inputs and calculate the souvenir price for the specified purchase according to Table 1. All product's prices are subject to Sales and Service Tax (SST). Therefore, the total price must include 10% of the SST. Repeat the same task using repetition structure until user enter “n’ for no. At the end of the program produce total price, tax amount and price after tax. Table 1 Product Type Product Code Product Description Price per Product 101 Sport medal RM 4.50 Metal Craft 102 Кeychain RM 3.00 201 Sticker RM 1.50 Gift and Craft 202 Mug RM 5.20 203 Postcard RM 1.00 As a programmer, you are asked to develop a C program using if...else statements or switch statements and loop where it is appropriate and create a program with the following output (The numbers in bold/underline are user's input). Your program should show an invalid message if product code chosen by users are other than code listed in the table. **********MAJUJAYA SOUVENIR CALCULATOR* Please enter your product code: 202 Please enter the number of products needed: 100 Souvenir price: 520.00 Would you like to buy another product? y Please enter your product code: 101 Please enter the number of products needed: 173 Souvenir price: 778.50 Would you like to buy another product? n Total price: 1298.50 Tax amount: 129.85 Price after tax: RM1428.35
Expert Solution
steps

Step by step

Solved in 3 steps with 2 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