STARBUCKS COFFEE offers a loyalty rewards program for customers with two levels: Green and Gold. It decides to give discounts on beans' bags based on customer level and the number of bought bags as shown in the table below: Level Number of bags 25 bags 2 10 bags 25 bags Discount 5% of total price 10% of total price 15% of total price 20% of total price Green (R) Gold (G) 2 10 bags Knowing that each bag of beans cost 45 SR, write a program that reads customer loyality level: R for Green or G for Gold, and the number of bags to buy. Your program should then caleulate and print the total cost of the order as shown in the sample run Note: • Use awitch with the input level. Your program should accept both uppercase and lowercase for the input level. ĮSample Run #1] Enter your loyality level (R for Green) or (G for Gold): R Enter the number of beans bags: 7 ****STARBUCKS*** Number of bags ordered: 7| 315 SR Discount: -15.75 Your total charge is 299.25 SR ISample Run #2] Enter your loyality level (R for Green) or (G for Gold): Enter the number of beans bags: ****STARBUCKS** Number of bags ordered: 4| 180 SR Discount: -0 Your total charge is 180 SR

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
i need the answer quickly
STARBUCKS COFFEE offers a loyalty rewards program for customers with two
levels: Green and Gold. It decides to give discounts on beans' bags based on customer
level and the number of bought bags as shown in the table below:
Level
Number of bags
Discount
25 bags
2 10 bags
2 5 bags
2 10 bags
5% of total price
Green (R)
10% of total price
15% of total price
20% of total price
Gold (G)
Knowing that each bag of beans cost 45 SR. write a program that reads customer
loyality level: R for Green or G for Gold, and the number of bags to buy. Your program
should then caleulate and print the total cost of the order as shown in the sample run
Note:
Use gwitch with the input level.
• Your program should accept both uppercase and lowercase for the input level.
[Sample Run #1]
Enter your loyality level (R for Green) or (G for Gold): R
Enter the number of beans bags: 7
****STARBUCKS****
Number of bags ordered: 7| 315 SR
Discount: -15.75
Your total charge is 299.25 SR
[Sample Run #2]
Enter your loyality level (R for Green) or (G for Gold):
Enter the number of beans bags: 4
****STARBUCKS****
Number of bags ordered: 4 | 180 SR
Discount: -0
Your total charge is 180 SR
Transcribed Image Text:STARBUCKS COFFEE offers a loyalty rewards program for customers with two levels: Green and Gold. It decides to give discounts on beans' bags based on customer level and the number of bought bags as shown in the table below: Level Number of bags Discount 25 bags 2 10 bags 2 5 bags 2 10 bags 5% of total price Green (R) 10% of total price 15% of total price 20% of total price Gold (G) Knowing that each bag of beans cost 45 SR. write a program that reads customer loyality level: R for Green or G for Gold, and the number of bags to buy. Your program should then caleulate and print the total cost of the order as shown in the sample run Note: Use gwitch with the input level. • Your program should accept both uppercase and lowercase for the input level. [Sample Run #1] Enter your loyality level (R for Green) or (G for Gold): R Enter the number of beans bags: 7 ****STARBUCKS**** Number of bags ordered: 7| 315 SR Discount: -15.75 Your total charge is 299.25 SR [Sample Run #2] Enter your loyality level (R for Green) or (G for Gold): Enter the number of beans bags: 4 ****STARBUCKS**** Number of bags ordered: 4 | 180 SR Discount: -0 Your total charge is 180 SR
Expert Solution
steps

Step by step

Solved in 2 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