Task 3: Arrays Write and execute a JAVA program that will allow the user to input the prices of 7 items into an array using for loop. The program should determine the maximum price using while loop and then display the same. Sample output: Enter price:12 Enter price:34 Enter price:11 Enter price:2 Enter price:34 Enter price:56 Enter price: 78 maximum price: 78.0 Press any key to continue...i
Added by Luke H.
Close
Step 1
First, we need to create an array to store the prices of the items. We can declare an array of type double with a size of 7. Show more…
Show all steps
Your feedback will help us improve your experience
Corbin Tegner and 54 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
A shopkeeper offers 30% discount on purchasing articles whereas the other shopkeeper offers two successive discounts 20% and 10% for purchasing the same articles. Write a program in Java to compute and display the discounts . Take the price of an article as the input.
Shelayah R.
Design a program that asks the user to enter a store's sales for each day of a 7-day week. The amounts should be stored in an array. Use a loop to calculate the total sales for the week, the average sales per day, and also display the list of values. This is for Java.
Cora M.
write a java program to find first and second maximum element in array ?
Chandra J.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD