Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.

Note: immediately after your statement containing input.nextDouble() you will need to add the following input.nextLine() statement. This will cause the input scanner to consume the newline after your product cost. Otherwise, your program will skip the next input statement. The code should look like this:

productCost = input.nextDouble(); input.nextLine(); // Consume newline

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

More Books

Students also viewed these Databases questions