Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!