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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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