Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ SubMenu Program for Midterms CO SCI 243 Programming Project # 1 (100 points) Your goal is to implement an application that allows employees of

C++ SubMenu Program for Midterms

CO SCI 243 Programming Project # 1 (100 points)

Your goal is to implement an application that allows employees of a coffee shop to place a customer order.

Your application should:

get customer information including name, telephone number, and address (one field for each).

ask for the method of payment: Visa, MasterCard, or cash.

ask for customer credit card number if he/she selects Visa or MasterCard.

have four drink types (Coffee for $2.89, Espresso for $3.23, Cappuccino for $3.75, and Hot chocolate for $2.25) and five accessories (Coffee mug $16.97, Coffee press $22.90, Coffee scoop $6.05, Coffee grinder $24.99, Coffee mug warmer $10.99). All prices are for one order.

Drink types and accessories prices are shown on the screen next to each item (see list of menus below). The total price should include tax at the rate of 10.25%. Assume the customers could place one order at a time. Selecting one drink type will deselect the previous type. Accessories are optional. Selecting same accessory multiple times does not add to number of accessory. Clear option clears all selected accessories.

Gifts - select 2 accessories: Free cup of coffee; select 3 accessories: Free mug; select 4 or more accessories: $5.00 gift card. Note: Maximum one gift per order; Customer may not pick a desired gift.

calculate the total price when the user selects "Display Order Confirmation".

When the user selects the Display Order Confirmation option:

if the input is complete, your application must generate an order confirmation shown below.

if the input is incomplete, your application must generate one message, listing all the fields requiring completion.

The user should be able to input data in any order. Use functions (call-by-value only). Do not use global variables. Do not use arrays.

Make sure to test your program completely before submission. Do not forget to add comments.

The order confirmation should look like this:

You have placed an order for

Cappuccino ($33.33)

With the following options:

Coffee press ($2.22)

Coffee scoop ($3.33)

Total price: $88.88

Congratulations. You will get the following free gift with your order:

Free cup of coffee

Sold to: John Doe

Telephone: 12345

Address: 123 Nice St.

Paid by: Visa number 998877

===============================================

Menus:

1. Input Customer Information

2. Main Selection

3. Options

4. Payment Method

5. Display Order Confirmation

6. Exit

-------------------------------

1. Name

2. Phone Number

3. Address

4. Main Menu

------------------------------- 1. A ($44.44)

2. B ($33.33)

3. C ($22.22)

4. D ($11.11)

5. Main Menu

-------------------------------

1. aa ($1.11) 2. bb ($3.33) 3. cc ($4.44) 4. dd ($5.55) 5. ee ($6.66) 6. Clear all options 7. Main Menu ------------------------------- 1. Visa 2. MasterCard 3. Cash 4. Main Menu

Note: The prices on the menu are not accurate. Use the prices in the project description.

=============== Project Hint =================

#include  using namespace std; bool isOrderComplete(string s1); void displayErrors(string s1); void displayOrder(string s1); void displayMainMenu(); void displayCustomerInfoMenu(); string getName(); int main() { string name = ""; string missingInfo = ""; int choice; int subChoice; do { displayMainMenu(); cin >> choice; switch(choice) { case 1: do { displayCustomerInfoMenu(); cin >> subChoice; switch(subChoice) { case 1: name = getName(); break; case 2: break; default: cout << " Not a valid choice. " << "choice again. "; } }while(subChoice != 2); break; case 2: if (isOrderComplete(name)) displayOrder(name); else  displayErrors(name); break; case 3: break; default: cout << " Not a valid choice. " << "Choose again "; } }while (choice != 3); cout << " Thank you. "; system("PAUSE"); return 0; } void displayMainMenu() { cout << " 1. Input Customer Information " << "2. Display Order Confirmation " << "3. Exit " << " Your selection: "; } void displayCustomerInfoMenu () { cout << " 1. Name " << "2. Main Menu " << "3. Exit " << " Your selection: "; } void displayOrder (string s1) { cout << "Name: " << s1 << endl; } bool isOrderComplete (string name) { bool status = true; if (name == "") status = false; return status; } void displayErrors (string name) { string errors; cout << " Please complete: "; if(name == "") errors = "Name "; cout << errors; } string getName() { string customerName; cout << "Enter Name: "; cin >> customerName; return customerName; } 

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

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago