Write a complete java program called GroceryItems. Which will do the following tasks: 1- This program should ask the user: "How many grocery items you want to pay?" and store the answer in an integer variable. 2- Based on the number of the items, it should allow the user to enter the price of each item and store them in a one-dimensional array of type double. 3- The program should display an appropriate message to ask the user to enter items price. 4- Finally, it should find and print the total price and the average.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 11PE
icon
Related questions
Topic Video
Question
Using dr java
Write a complete java program called GroceryItems. Which will do the following tasks:
1- This program should ask the user: "How many grocery items you want to pay?" and
store the answer in an integer variable.
2- Based on the number of the items, it should allow the user to enter the price of each item
and store them in a one-dimensional array of type double.
3- The program should display an appropriate message to ask the user to enter items price.
4- Finally, it should find and print the total price and the average.
Transcribed Image Text:Write a complete java program called GroceryItems. Which will do the following tasks: 1- This program should ask the user: "How many grocery items you want to pay?" and store the answer in an integer variable. 2- Based on the number of the items, it should allow the user to enter the price of each item and store them in a one-dimensional array of type double. 3- The program should display an appropriate message to ask the user to enter items price. 4- Finally, it should find and print the total price and the average.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage