Question: Create a java program which will prompt a user to input a product and its cost.Using a while loop that will run until the sentinel

Create a java program which will prompt a user to input a product and its cost.Using a while loop that will run until the sentinel value of "stop" (any case) is entered, the program will look for items with a cost greater than or equal to $100.00.The program will find the average cost of those items.

Start your program as follows:

Products that cost $100.00 or more

Enter theproduct ordered - type 'stop' to end: flat screen TV

Enter the cost of the product ordered: 599.90

Enter the product ordered - type 'stop' to end: HD cable

Enter the cost of the product ordered: 25.02

Enter the product ordered - type 'stop' to end: laptop

Enter the cost of the product ordered: 1202.25

Enter the product ordered - type 'stop' to end: external drive

Enter the cost of the product ordered: 102.40

Enter theproduct ordered - type 'stop' to end: stop

There were 3 item(s) that had a cost of $100.00 or more

The average price of items with a cost of $100.00 or more is $634.85

End of report

Process finished with exit code 0

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 Programming Questions!