Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C++, using: juiceMachine.h, juiceMachineImp.cpp, main.pp as your file names The method sellProduct of the Juice Machine programming example gives the user only two chances
In C++,
using: juiceMachine.h, juiceMachineImp.cpp, main.pp as your file names
The method sellProduct of the Juice Machine programming example gives the user only two chances to enter enough money to buy the product. Rewrite the definition of the method sellProduct so that it keeps prompting the user to enter more money as long as the user has not entered enough money to buy the product. Also, write a program to test your method.
Your program should produce the following output:
*** Welcome to Shelly's Juice Shop *** To select an item, enter 1 for orange juice (50 cents) 2 for apple juice (65 cents) 3 for mango juice (80 cents) 4 for strawberry banana juice (85 cents) 9 to exit 3 Please deposit 80 cents 40 Please deposit another 40 cents. 40 Collect your item at the bottom and enjoy. *** Welcome to Shelly's Juice Shop *** To select an item, enter 1 for orange juice (50 cents) 2 for apple juice (65 cents) 3 for mango juice (80 cents) 4 for strawberry banana juice (85 cents) 9 to exit 9
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started