Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Conditional Statements in C++ 1. Your company has decided to offer a rewards program for its loyal customers. The rewards program offers three levels, Gold(G),

Conditional Statements in C++ 1. Your company has decided to offer a rewards program for its loyal customers. The rewards program offers three levels, Gold(G), Silver(S), and Bronze(B). Discounts on the customers sales receipt are provided in the table below along with additional discounts for only the amount of the purchase over $200.00. A maximum discount amount for any purchase is $30.00. Your program should prompt the user for their current reward level and sales receipt amount. Based on the table below, calculate and display the customers discount. Reward Level Discount Additional Discount for amount over $200 Gold 12% 3.50% Silver 8% 2.25% Bronze 4% 1.75% 1. Using the parameters above, create a detailed flowchart or pseudocode outlining your program design. Some things to keep in mind while developing your solution: The majority of program development follows the steps of gathering input, perform calculations, then display output. Create a separate list of variables and their data types; variables can be added to the list as you continue developing your solution Start with the basic program flow for a single reward level Add specifics of the program as you further develop the solution Add the error checking features Your program should not contain an excessive amount of repeated code. Review your flowchart to ensure you are designing your code in the most efficient manner. 2. From your flowchart or pseudocode, translate each step into C++ code to develop your code. Keep the following points in mind when creating your program: Provide your company name in the output. Your program should perform input validation to make sure only G, S, or B is entered as a reward level and for negative sales amounts. The program should display an appropriate error message and end for invalid input. Do not use break; (except for switch statement) or continue; statements in your code. Well-structured programs only have a single return; statement. Make sure you are using the correct data types and descriptive variable names. Do not use goto or exit statements in your code. Be sure to include all three conditional statements (if, switch and condition) statements in your program. Your program should be user-friendly. Add a comment to the top of your program that includes your name, the program name, and a description of the program code. Include descriptive comments throughout your program. Do not use loops or arrays in your code. Save the file as Rewards.cpp or main.cpp For an extra challenge,(but not required) have your program display the additional savings the customer would save if they qualified for the other reward levels. 3. After completing the assignment attach your Rewards lastname.cpp or main.cpp file and flowchart/pseudocode to the Assessment link for grading.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions