subject

Write a program that receives a filename as user input. The file is structured as multiple lines containing numbers separated by a single space. For example, this would be an acceptable file:
1 2 3 4 5 6 7 2
Your program should open this file and:
1. print all its contents;
2. write the median of all numbers to a new file called result. txt.
IMPORTANT NOTES:
a. the median is the element in the middle when you sort the values;
b. the median of values (2, 1, 3) is 2, because when you sort them, you get 1, 2, 3, and 2 is the value in the middle.
c. you can assume there will be no empty lines;
d. there might be any arbitrary number lines in the file;
e. there might be any arbitrary number of elements in a single line;
f. you can assume there will always be an odd number of elements.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 16:00
Create a logic array qualifyingindex with true for any location where the runner is male with a running time less than 8.2. row array runnergenders indicate if a runner if male (m) or female ( f. row array runnertimes indicates the corresponding runner's time.
Answers: 1
question
Computers and Technology, 22.06.2019 07:30
In the film "epic 2015," epic is the name for:
Answers: 3
question
Computers and Technology, 22.06.2019 14:30
If the polar bear were taken out of the food chain what would happen to the seal population the seal population would diminish the seal population would grow dramatically the seal population would stay the same the seal population would decrease slightly
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
What does 21 pilots middle aged name as a band 15 years prior to them naming their band 21 pilots?
Answers: 1
You know the right answer?
Write a program that receives a filename as user input. The file is structured as multiple lines con...
Questions
question
Chemistry, 02.04.2020 16:13
question
Mathematics, 02.04.2020 16:18
question
Mathematics, 02.04.2020 16:19