Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODE IN C++ VISUAL STUDIO ONLY (This must not be done in windows form GUI) *Follow requirements Design a program as a prototype of an

CODE IN C++ VISUAL STUDIO ONLY (This must not be done in windows form GUI)

*Follow requirements

Design a program as a prototype of an app for your pop-up food truck business. Your food truck sells five items.

Each item has a name, description, base price, and three options for add-ons. The add-ons are unique to the item. Each add-on has a unique price.

Use an array of structs, functions, parameter passing, and a user-friendly interface to build your prototype for the app.

Show the user a Main Menu with the following options:

1. Show Menu

2. Order Items

3. Check Out

4. Exit

Show Menu: Displays all 5 Main Menu items along with a short description of the menu item and the base price. Also, list the three add-on options and the respective prices. Format it in a user-friendly format to show the user all the options on the menu.

Order: Presents an order menu to the user. The top-level menu lists only the 5 menu items for sale (not all the add-on choices). Once the user chooses a menu item, then display the add-on choices and prices. Allow the user to add on zero, 1, 2, or all 3 add-ons. Show the user the price for the food item with any add-ons. Ask the user if they wish to order another item. Either show the Order Menu again to continue adding to the order, or show the Main Menu.

Check Out: Add a Mobile Food Vendor's tax of 7.5% tax to the total. Display an itemized receipt that includes the number of items ordered along with a user-friendly list of each item with add-ons and the item total as well as a grand total. A table format is preferred but other user-friendly formats are fine.

Exit: End the program

Requirements

Use two arrays of Structs, one for the Menu Items and one for the Ordered Items.The Menu Items Struct array has 5 items in it, the five items you sell.

The member data includes, name, description, cost, addOns[3], addOnCost[3]

The Ordered Items Struct array is filled as the customer orders.

The Ordered Items Struct array holds up to 30 items. You must keep track of the actual number of items ordered with a variable so that when you loop through the array you stop at the last item ordered (otherwise you will get an out of bounds error).

The Ordered Items array holds the item name with any add-ons ordered and the item price.

You have flexibility in how you design the member data for this Struct. Here is one possible design

The member data includes the item name, add on descriptions (no array needed), item price.

The only global constant permitted is the tax rate of 7.5%. No other global variables or constants are permitted. Use parameters.

Use a function to initialize the array of structs.

Hardcode the product data into the initialize function. This is a brute force method but it's acceptable for this project. The better option is to read it in from a file, but I don't want to require that on this project.

This means you use a series of assignment statements to initialize the Menu Struct

All code is to be logically broken down into appropriate user-defined functions to accomplish the necessary tasks.

All input from the user must be validated using a Boolean isValid function.

You may need to create overloaded isValid functions depending on your implementation.

You may assume the user will input within the correct data type. You only need to validate for range or valid choices as we've done in the exercises in this class.

Utilize switch for menu selections.

Utilize appropriate looping structures.

Use efficient design; no brute force solutions.

Use good style.

HINTS: Exit only through the Menu Option to Exit. Avoid the use of BREAK statements except in Switch. Use prototypes and follow prototypes with the main function. Add a generous amount of comments. Add blank lines to separate logical blocks of code.

add functionality to input name and email for updates on where the food truck will be located and when specials are offered. Confirm that it is correct, and offer the user a chance to edit it again if it is not correct

add functionality to offer the user a 10% discount for orders over $50 and a 15% discount for orders over $100.

TIPS

Check your style. Clean up indenting and spacing. Be sure you have descriptive identifiers. Be sure to document your code with comments.

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Eric Redmond ,Jim Wilson

1st Edition

1934356921, 978-1934356920

More Books

Students also viewed these Databases questions

Question

t/f The audience for a staff report may be an individual

Answered: 1 week ago