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, 22.06.2019 06:00
Write a function that draws a pool ball. this function should take as parameters, the color, the number that should go on the pool ball, and the location of the center of the pool ball. the radius of the pool balls should be pool_ball_radius, and the font of the number should be pool_ball_font. the text of the pool ball font should be white. drawpoolball(color.orange, 5, 100, 100); drawpoolball(color.green, 6, 50, 200); drawpoolball(color.red, 3, 150, 350); drawpoolball(color.blue, 2, 250, 140); to center the numbers on the pool ball, you should use the getwidth() and getheight() methods. you are allowed to call these methods on your text object, such as txt.
Answers: 3
question
Computers and Technology, 22.06.2019 08:40
What are the three parts to physical security standards for various types of army equipment and the risk level
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Write an essay on online collaboration, how to do it, the challenges, resolving the challenges, and consider whether the risks are greater than rewards. ( need )
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
Brian wants to conduct an online search with a certain phrase. he intends to use the words books that belong to the 1800s in his search. how should he use the word that in his search?
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
Mathematics, 26.10.2019 02:43
Questions on the website: 13722367