Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

***Please write code in c++*** CONCEPT: Methods are ideal for use in menu-driven programs. When the user selects an item from a menu, the program

***Please write code in c++***

CONCEPT: Methods are ideal for use in menu-driven programs. When the user selects an item from a menu, the program can call the appropriate method.

image text in transcribed

Write a menu-driven program for De Anza College Food Court. (You need to use Methods !)

  • Display the food menu to a user (Just show the 5 options' names and prices - No need to show the Combos or the details!)
  • Use numbers for the options and for example "6" to exit.
  • Ask the user what he/she wants and how many of it. (Check the user inputs) AND use trim() function to trim your inputs(if needed)
  • Keep asking the user until he/she chooses the exit option.

You should have two classes, the first one is a driver class and the second one is the order class and includes these methods:

  • A method to display the menu => displayMenu()
  • A method to get inputs => getInputs()
  • A method to calculate the tax and the bill => calculate(.....)
  • A method to print the bill => printBill(....)
  • You can use quantity1,quantity2,quantity3,quantity4,quantity5 to save the quantities of the burgers and put them inside an array
  • You can use a constant array variable for the prices like priceArray = [5.25,5.75,5.95,5.95,5.95]

Note: You can use your own code design and naming methods. Better designs will get better grades.

Note: It is a good design if your main method is short and you call other methods from the main method. It means, it is better to use different methods instead of putting all your code in the main method.

  • Calculate the price.
  • Ask the user whether he/she is a student or staff. There is no tax for students and a 9% tax for staff. Add the tax price to the total price.
Tax

Cupertino

9.000%

Santa Clara

  • Display the bill to the user. The bill includes:
    • The food items
    • The quantities
    • The cost of them
    • The total before tax
    • Tax amount
    • Total price after tax

You can have your own design but you need to have a main method and get started from the main method.

The name of methods also up to your design but the names should show what the methods do.

  • Only display 2 decimal points when displaying all the numbers.
  • Put at least two outputs (results after you run your code) at the end of your code as a multi-line comment.
Burger Club www.deanza.edu/ diningservices/ calendar.html Grill Hours 10:35 am - 7:30pm De Anza Grill Get Classics De Anza Burger Western Burger Don Cali Burger Combo #1 Add Small Drink $1.25 Charbroiled Beef Patty, Green Leaf, Tomato, Red Onion, White Cheddar on Toasted Bun Bacon Cheese Charbroiled Beef Patty, Smoked Bacon, Caramelized Onion & American Cheese on Toasted Bun Mushroom Swiss Beef Patty, Mushrooms & Swiss Cheese, Garlic Mayo, Green Leaf Lettuce, & Tomato, on Toasted Bun Charbroiled Beef Patty, Charbroiled Beef Patty, Beer Battered Onion Rings, Spring Mix Lettuce Sriracha BBQ Sauce & Tomato, Red Onion, American Cheese Avocado, Smoked Gouda on Toasted Bun & Bacon on Toasted Bun Combo #2 Add Fries $1.75 Curly Fries $2.25 $5.75 $5.95 $5.95 $5.25 $5.95 Combo #3 Add Drink Fries $2.65 Add Drink Curly Fries $2.95 No Substitutions Please House Seasoned - Charbroiled to Order

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

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

Describe five career management practices

Answered: 1 week ago