SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Walter Savitch ,julia Lobur
Chapter:
I/o Streams As An Introduction To Objects And Classes
Exercise:
Programming Projects
Question:3 | ISBN:9780321531346 | Edition: 7

Question

a. Compute the median of a data file. The median is the number that

has the same number of data elements greater than the number as

there are less than the number. For purposes of this problem, you

are to assume that the data is sorted (that is, is in increasing order).

The median is the middle element of the file if there are an odd

number of elements, or the average of the two middle elements if

the file has an even number of elements. You will need to open the

file, count the members, close the file and calculate the location of

the middle of the file, open the file again (recall the “start over” discussion

in this chapter), count up to the file entries you need, and

calculate the middle.

If your instructor has assigned this problem, ask for a data file to test

your program with. Otherwise, construct several files on your own,

including one with an even number of data points, increasing, and one

with an odd number, also increasing.

b. For a sorted file, a quartile is one of three numbers: The first has onefourth

the data values less than or equal to it, one-fourth the data values

between the first and second numbers, one-fourth the data points

between the second and the third, and one-fourth above the third

quartile. Find the three quartiles for the data file you used for part (a).

Hint: You should recognize that having done part (a) you have onethird

of your job done. (You have the second quartile already.) You

also should recognize that you have done almost all the work toward

finding the other two quartiles as well.

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Sorry the answer is not available at the moment…

If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.

Spread the 'tradition of sharing'.