Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is C++ for beginner Need to do nested loop to ask customer what kind of sandwich do they want Ham $4, Veggie $3, Rat

this is C++ for beginner
Need to do nested loop to ask customer what kind of sandwich do they want
Ham $4, Veggie $3, Rat $2
Keep asking if they want more sandwich until they want to stop then show the total price.
image text in transcribed
image text in transcribed
last homewrk is just a program to ask customer what kind of sandwich do they want : Ham $4 Veggie $3 or Rat $2 . this week is needed to use nested loop to keep asking, and handle when they input wrong number or they want to stop
Available after Mar 2 at 12am You are writing a program for a Which Wich cash register. You already have code that can make one sandwich. Instead of telling them the price of just the one sandwich, keep asking if they want another sandwich until they choose to stop. Then print the total cost of all sandwiches. You need to check if their input is valid (nested loop) but you don't need to worry about wrong types. Fixing them entering anh when you want a 2 will be covered in a few weeks. (So if the choices are 1, 2, 3, you need to handle 10 or -3, but you don't need to handle 'h' or 'p.) Essentially: Take last week's homework, and put it in a loop. You don't need to port the toppings code. just the multiple sandwich types and their prices. How you do it is up to you. This class is at CS175: Cash Register Design. The theme of the homework doesn't matter. The heart of this whole major is learning the tools you need to solve any problem. If you are totally lost, man sure would be nice if the teacher was on chat 15 hours a week. Oh wait! That's me. Not handling bad input by just saying there is no bad input doesn't count. Say the input is bad and ask again. Making all inputs numbers instead of words will save us both headaches later. do { If you are totally lost, man sure would be nice if the teacher was on chat 15 hours a week. Oh wait! That's me. Not handling bad input by just saying there is no bad input doesn't count. Say the input is bad and ask again. Making all inputs numbers instead of words will save us both headaches later. do { // Show menu and prices do { // input here Jwhile (Bad sandwich input); (1 2 3) // Code to total price do { // input here }while(bad exit input); (1 2) }while(don't want to quit); // Show total Week 95) Loops Program Rubric Pts

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Consider this article:...

Answered: 1 week ago