Using Java
Create an application that creates and displays a list of namesusing an array. Then modify the application to create and use alist of numbers.
Console for the names application
Please entera name or type “exit” to quit: Diane
Please entera name or type “exit” to quit: Joe
Please entera name or type “exit” to quit: Greta
Please entera name or type “exit” to quit: Henry
Please entera name or type “exit” to quit: exit
The namesyou entered were:
Diane
Joe
Greta
Henry
Console for the numbers application
Please entera number or type “exit” to quit: 12.5
Please entera number or type “exit” to quit: 75
Please entera number or type “exit” to quit: 200
Please entera number or type “exit” to quit: -.02
Please entera number or type “exit” to quit: exit
The numbersyou entered were:
12.5
75
200
-.02
Sum:287.48
Average:71.87
Chapters 7-13 Review Exercise 2: Names and Numbers(continued)
Specifications
Part 1:
- Prompt the user to enter a first name, or enter “exit” toquit.
- Notice there will be only one prompt in this program, insteadof one to get the name and the other to ask if the user wants tocontinue.
- Store all names in an array. When the user enters “exit”display all the names entered.
Part 2:
- Make a copy of the program you have just written, and modify itas follows.
- Prompt the user to enter a number, or enter “exit” toquit.
- The numbers entered may be decimal numbers or integers.
- Store all numbers in an array.
- When the user enters “exit”, display the numbers entered, theirsum, and the average.
- For this version of the program, you must read everything as astring, and then convert the numbers appropriately beforeperforming the calculations.
Expert Answer
Answer to Using Java Create an application that creates and displays a list of names using an array. Then modify the application t…