Write a function find median that takes a file handle

Assignment Help Computer Engineering
Reference no: EM132199079

Question :

Write a function find_median that takes a file handle as an input and find the median of a group of scores. Requirements:

o Readthegroupofscoresfromafile(thatcontainsnumbersonly,eachlinehas3 numbers), and put the scores into a list.

o Your function must sort the elements in order.

Find and return the median from the sorted list of scores. Here a median is the middle element of a sorted list if the number of elements is odd, and the average of the two middle elements if the number of elements is even.

o for a list [10,20,30,40,50], the median is 30 as it is the middle element (odd number of elements in the list)

o for a list [10,20,30,40,50,60], the median is 35 as it the average of 30 and 40 (two middle item in an even number of elements in the list)

Write a program q2.py that asks the test find_median function and write/print the results to

the output file output_q2.txt

SN/5467-231

SN5467-231

SN/5467-2231

SN/1234-978

SN/1607-123

SN/1408-456

SN5467-231

SN123-1234

SN*12345672

SN/2304-567

Reference no: EM132199079

Questions Cloud

How a change in the exchange rate affected your firm : Explain what happened to your price and quantity. Howcan you profit fromfuture shifts in the exchange rate? How do you predict future changes in the exchange
Write a function that accepts as parameters an array : Write a function, extremeAverage, that accepts as parameters an array of integers as well as the size of the array.
Determine the elasticity of demand for a given product : What are the two primary factors that determine the elasticity of demand for a given product or services?
What was the nominal interest rate last period : You need both equations and clearly labeled graphs (separate graphs for each question) to answer the following questions. Assume that b=1/2 and that initially.
Write a function find median that takes a file handle : Write a function find_median that takes a file handle as an input and find the median of a group of scores. Requirements:
Distinguishes normal and inferior goods : Define income elasticity and how it distinguishes normal and inferior goods.
Write a function in mips assembly which assumes the values : Write a function in MIPS assembly which assumes the values of i and j are stored in $a0 and $a1 respectively
How to calculate and graph the profit maximizing price : Explain how to calculate and graph the profit maximizing price and quantity in the output markets by use of marginal analysis.
Write a function that its input is a long integer : Write a function, that its input is a long integer and a bit number in a char, and returns a 1 if the bit at location bit number is set to 1.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Describe how a computer and information systems manager

describe how a computer and information systems manager could effectively manage in a virtual environment based on

  Determine the possible iterative steps

Determine the steps in the development of an effective Entity Relationship Model (ERM) Diagram and determine the possible iterative steps / factors.

  When you first receive an rfp what three parts should you

question 1.when you first receive an rfp what three sections should you look at to determine if your firm is going to

  Display the lcs table produced by the algorithm

In this programming exercise you will implement the algorithm we developed in class for solving the Longest Common Subsequence problem.

  A program that converts knuts to sickles and galleons

Write a C program that converts knuts to sickles and galleons (the currency of the HarryPotter novels).The user will enter the total number of knuts.

  Create a application that can be used to input a users name

Create a Windows application that can be used to input a user's name. Include an appropriate label indicator for the name and a textbox for the input entry.

  Why does a thread move from the ready state to running state

How and why does a thread move from the ready state to the running state? How and why does a thread move from the running state to the blocked state?

  Write a mips program guess

Write a MIPS program guess which tries to guess what number you have chosen in as few guesses as possible. It can only ask you whether the number is less than some other number.

  Understand business to business markets

What are the Buying Center Participants? In your opinion, which of these participants is the most important to a business-to-business marketing manager?

  How many digits the number has

Write a program that reads an integer and prints how many digits the number has, by checking whether the number is = 10, = 100, and so on.

  What is the expected number of guests that end up

What is the expected number of guests that end up in a room with exactly one other person?

  Create two columns layout

Pick any topic Write html &css code in which there is only one page but there is a header & two columns.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd