Write a program that repeatedly asks the user to enter numbers (or blank to exit). After the user enters a blank line, the numbers will be sorted into ascending order and displayed as a sorted list. The program will also calculate and display the median value.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

Please send me answer of this question immediately and i will give you like sure sir 

Write a program that repeatedly asks the user to enter numbers (or blank to exit). After the user enters a blank
line, the numbers will be sorted into ascending order and displayed as a sorted list. The program will a
calculate and display the median value.
Notes:
• You can assume all the input numbers will be integer values
• If the list has an odd number of items, then the median is the middle value in the sorted list.
• If the list has an even number of items, then the median is the average of the middle two values.
Printing a list will produce the output in the correct format (e.g., [1, 2, 3, 4])
• The output must be in the format shown in the example, including the format of the prompt, and all spaces and
punctuation.
●
For example:
Input Result
3
2
1
Enter a number (blank to exit): 3
Enter a number (blank to exit): 2
Enter a number (blank to exit): 1
Enter a number (blank to exit):
Data: [1, 2, 3]
Median: 2
Show Transcribed Text
use python only
Transcribed Image Text:Write a program that repeatedly asks the user to enter numbers (or blank to exit). After the user enters a blank line, the numbers will be sorted into ascending order and displayed as a sorted list. The program will a calculate and display the median value. Notes: • You can assume all the input numbers will be integer values • If the list has an odd number of items, then the median is the middle value in the sorted list. • If the list has an even number of items, then the median is the average of the middle two values. Printing a list will produce the output in the correct format (e.g., [1, 2, 3, 4]) • The output must be in the format shown in the example, including the format of the prompt, and all spaces and punctuation. ● For example: Input Result 3 2 1 Enter a number (blank to exit): 3 Enter a number (blank to exit): 2 Enter a number (blank to exit): 1 Enter a number (blank to exit): Data: [1, 2, 3] Median: 2 Show Transcribed Text use python only
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Map
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