as || , you will design a simple salad bar interface. The program will display a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
as || , you will design a simple salad bar interface. The program will display a main menu to the user to begin. User will choose from given options to order types of salad, calculate and display total cost and tax. The program will repeat taking user input until user hits exit option. Design your solution: 1. Main menu: Create a main user menu to display the main options to the user. User have the option to choose between 1 and 3. The program will display an error message if user option is not within the valid selection (less than 1 and greater than 3). Think about using a conditional structure to serve the user choice. Invalid option (for e.g. 4) can be handled with default else block (please see sample I/O for error message). A main menu is as follows and detailed of each option is provided below: 1. Order Salad 2..Checkout 3. Quit a. Order Salad: User can order three different types of salad base: veggie, seafood and protein-based. Like main menu any invalid option will display an error message. A sample menu is as follows along with price: Salad Menu 1. Vegetarian - $8.99 2. Seafood - $12.99 3. Protein - $10.99 b. Checkout: Option 2 'Checkout' in main menu will calculate the total cost along with the sales tax. To calculate the tax, you can multiply sales tax with total cost. For this program, you can assume VA sales tax 5.2%. c. Quit: Quit will simply exit the program once user hits '3'. You can display a message for this option. (See below sample 1/0) Sample I/O: (user input shown in black) Sample run-1 (no error) ***********Welcome to Salad Bar *********** 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 1 Salad Menu 1. Vegetarian - $8.99 2. Seafood - $12.99 3. Protein - $10.99 Enter your salad selection (1-3): 1 One veggie salad added to your cart. 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 1 Salad Menu 1. Vegetarian - $8.99 2. Seafood - $12.99 3. Protein - $10.99 Enter your salad selection (1-3): 3 One protein-based salad added to your cart. 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 2 Checking out... Your total before tax: 19.98 Total tax (5.2%): 1.03896 Your total after tax: 21.01896 **** Thanks for using Salad Bar *********** 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 3 Exiting the program. Sample run-2 (with error message shown in red) ***********Welcome to Salad Bar *********** 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 4 #Error message Invalid option. Returning to main menu. 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 1 Salad Menu 1. Vegetarian - $8.99 2. Seafood - $12.99 3. Protein - $10.99 Enter your salad selection (1-3): 4 #Error message Invalid option. Returning to main menu. 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 1 Salad Menu 1. Vegetarian - $8.99 2. Seafood - $12.99 3. Protein - $10.99 Enter your salad selection (1-3): 1 One veggie salad added to your cart. 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 2 Checking out... Your total before tax: 8.99 Total tax (5.2%): 0.46748000000000006 Your total after tax: 9.45748 ***** Thanks for using Salad Bar *********** 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 3 Exiting the program. as || , you will design a simple salad bar interface. The program will display a main menu to the user to begin. User will choose from given options to order types of salad, calculate and display total cost and tax. The program will repeat taking user input until user hits exit option. Design your solution: 1. Main menu: Create a main user menu to display the main options to the user. User have the option to choose between 1 and 3. The program will display an error message if user option is not within the valid selection (less than 1 and greater than 3). Think about using a conditional structure to serve the user choice. Invalid option (for e.g. 4) can be handled with default else block (please see sample I/O for error message). A main menu is as follows and detailed of each option is provided below: 1. Order Salad 2..Checkout 3. Quit a. Order Salad: User can order three different types of salad base: veggie, seafood and protein-based. Like main menu any invalid option will display an error message. A sample menu is as follows along with price: Salad Menu 1. Vegetarian - $8.99 2. Seafood - $12.99 3. Protein - $10.99 b. Checkout: Option 2 'Checkout' in main menu will calculate the total cost along with the sales tax. To calculate the tax, you can multiply sales tax with total cost. For this program, you can assume VA sales tax 5.2%. c. Quit: Quit will simply exit the program once user hits '3'. You can display a message for this option. (See below sample 1/0) Sample I/O: (user input shown in black) Sample run-1 (no error) ***********Welcome to Salad Bar *********** 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 1 Salad Menu 1. Vegetarian - $8.99 2. Seafood - $12.99 3. Protein - $10.99 Enter your salad selection (1-3): 1 One veggie salad added to your cart. 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 1 Salad Menu 1. Vegetarian - $8.99 2. Seafood - $12.99 3. Protein - $10.99 Enter your salad selection (1-3): 3 One protein-based salad added to your cart. 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 2 Checking out... Your total before tax: 19.98 Total tax (5.2%): 1.03896 Your total after tax: 21.01896 **** Thanks for using Salad Bar *********** 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 3 Exiting the program. Sample run-2 (with error message shown in red) ***********Welcome to Salad Bar *********** 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 4 #Error message Invalid option. Returning to main menu. 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 1 Salad Menu 1. Vegetarian - $8.99 2. Seafood - $12.99 3. Protein - $10.99 Enter your salad selection (1-3): 4 #Error message Invalid option. Returning to main menu. 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 1 Salad Menu 1. Vegetarian - $8.99 2. Seafood - $12.99 3. Protein - $10.99 Enter your salad selection (1-3): 1 One veggie salad added to your cart. 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 2 Checking out... Your total before tax: 8.99 Total tax (5.2%): 0.46748000000000006 Your total after tax: 9.45748 ***** Thanks for using Salad Bar *********** 1. Order Salad 2. Checkout 3. Quit Select your option (1-4): 3 Exiting the program.
Expert Answer:
Answer rating: 100% (QA)
Here is the Python code for the salad bar interface PYTHON def main Create a main menu print Welcome to Salad Bar print1 Order Salad print2 Checkout print3 Quit Get the users choice choice intinputSel... View the full answer
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
List three specific parts of the Case Guide, Objectives and Strategy Section (See below) that you had the most difficulty understanding. Describe your current understanding of these parts. Provide...
-
What does the following code fragment print? String \(s=\) "He11o World"; s. toUpperCase(); s. substring (6, 11); StdOut.println(s);
-
A radiation detector having a sensitive area of Ad = 4 x 10-6 m2 is configured to receive radiation from a target area of diameter D1 = 40 mm when located a distance of L1 = 1 m from the target. For...
-
consider the following bonds, each with a face value of $100: Type of bond Zero coupon Zero coupon Zero coupon Annual-pay coupon Maturity Coupon 1 2 3 2 a. What arbitrage trade would you do? 0 0 0 5%...
-
Thomas Brookie went shopping in the Winn Dixie Supermarket. He purchased his items and brought them to the car without incident. He then made additional trips in and out of the store to get empty...
-
LaPorta Company and Lott Corporation, two corporations of roughly the same size, are both involved in the manufacture of in-line skates. Each company depreciates its plant assets using the...
-
push ('Arabic') push ('French') pop() push ('English') push ('Spanish') 1) Draw this stack (In an array of 5 elements implementation) 2) What is the language given by the Top element? 3) In which...
-
When faced with different alternatives, there are many criteria that can be used to identify the best one. What is the tangible criterion that is usually used in an engineering economic analysis?
-
Consider the potential impact of each of the PESTEL factors on your organization Consider Porters Five Forces utilizing as it relates to your company
-
The function \(\mathrm{A}(f)\) corresponding to Bode plot of shown below is (a) \(\mathrm{A}(f)=j f / f\) (b) \(\mathrm{A}(f)=1 /\left(1-j f_{1} / fight)\) (c) \(\mathrm{A}(f)=1 /\left(1+j f /...
-
Consider the following plots. The plots which represent marginally stable systems, would include (a) 1 and 2 (b) 3 and 4 (c) 1 and 3 (d) 2 and 4. 1. |G| 0 dB ZG -180 (0 ge pe co (log scale) 2. |G| 0...
-
Find transfer function model for each of the following \(d B\) plots (assume minimum phase characteristics). dB 0 -3 -9 dB 0 -6 dB/octave 2 -12 dB/octave 48 30 60 (a) 20 (b) wo(log scale) (log scale)...
-
The Nyquist plot for a control system is shown below. The Bode plot for the same system will be (0=0 Im (10) = Re
-
The pole-zero map and the Nyquist plot of the loop transfer function GH(s) of a feedback system are shown below. For this (a) both open loop and closed loop systems are stable. (b) open loop system...
-
Archie Stanton starts a trucking business on January 1st, 2020. He decides to rent his premises in which to conduct his business and house his trucks. On January 1st he purchases 5 trucks each...
-
Nate prepares slides for his microscope. In 1 day he prepared 12 different slides. Which equation best represents y, the total number of slides Nate prepares in x days if he continues at this rate? A...
-
What effect on sample size does using a greater confidence level have when sampling attribute data?
-
Now Glinda and Elphaba are even more confused than before. They have three distinct options: to create a package on their own, buy commercial off-the-shelf software such as QuickBooks Pro, or...
-
List three advantages of using a PERT diagram over a Gantt chart for scheduling systems projects.
-
The activity of a sample of the cesium isotope \({ }^{137} \mathrm{Cs}\) is \(2.0 \times 10^{8} \mathrm{~Bq}\). Many years later, after the sample has fully decayed, how many beta particles will have...
-
What is the activity in \(\mathrm{Bq}\) and in \(\mathrm{Ci}\) of a \(2.0 \mathrm{mg}\) sample of \({ }^{3} \mathrm{H}\) ?
-
The technique known as potassiumargon dating is used to date volcanic rock and ash, and thus establish dates for nearby fossils, like this 1.8 -millionyear-old hominid skull. The potassium isotope...
Study smarter with the SolutionInn App