Answered step by step
Verified Expert Solution
Link Copied!

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

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

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions

Question

Briefly explain Social media and its influence on the human mind.

Answered: 1 week ago

Question

how would you have done things differently?

Answered: 1 week ago