Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create an Array using java that stores 10 different prices. Prompt a user to enter 10 different prices and save each price to array(you must

Create an Array using java that stores 10 different prices. Prompt a user to enter 10 different prices and save each price to array(you must use a loop to store each price to array), then calculate and display the sum and average of the prices(use a loop). Next, create a static method that display all prices of less than $5.00. Finally, create another method that display all prices that are higher than the calculated average. The results of the program look like following:

Sample Run:

Enter the price 1: $12.50

Enter the price 2: $3.50

Enter the price 3: $4.50

Enter the price 4: $2.25

Enter the price 5: $1.19

Enter the price 6: $22.45

Enter the price 7: $44.67

Enter the price 8: $10.79

Enter the price 9: $9.99

Enter the price 10: $12.45

Price less than $5.00:

$3.50

$4.50

please put comments.

$2.25

$1.19

Sum of All Prices: $124.29

Average: $12.43

Prices higher than average:

$:12.50

$:22.45

$:44.67

$:12.45

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

Determine the amplitude and period of each function.

Answered: 1 week ago