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 elements, 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
b. For a sorted file, a quartile is one of three numbers: The first has one-fourth 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 one third 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.)
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
Problem Solving with C++ (10th Edition)
Additional Engineering Textbook Solutions
Starting out with Visual C# (4th Edition)
C How to Program (8th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
- Please design the mapper and reducer for the below WordCount problem. WordCount problem: Given an input text file, count the frequency of each word in the file. Please design the input and output pairs for the Mapper and Reducer, use below table for reference. Input Output We get the "WordCount.jar" file by using the above table. It only contains Mapper and Reducer. There is no Combiner and no Partitioner in this program. Please illustrate how the WordCount.jar program works on the below dataset. This text file only contains one line. Dataset: the sound sounds sound. it is the right right, right? Suppose we run the WordCount.jar program on this file. Suppose that the space symbol, and "?" are all used for separating the words. The outputs of the Mapper are Mapper The outputs of the reducer are Reducer Answer: Are the results sorted alphabetically? When was it sorted? 2 27 20 35arrow_forwardPython usearrow_forward*Student information is being held in a data area, where each student record has the following format: The first nine bytes are the student number, held in ASCII The next byte is the course mark The next word is the section identifier 10009. There are well over three hundred such student records that have been loaded sequentially into memory starting at address $10000. The last record loaded is a dummy record with a section identifier of $FFFF, to show the end of the rècords. If a2 has the address of a student record, what is the location of the next record in the array / data area. Explain your answer.arrow_forward
- Write a Program in C Language.arrow_forward3. Laramie Park District has files of participants in its summer and winter programs this year. Each file is in participant ID number order and contains additional fields for first name, last name, age, and class taken (for example, Beginning Swimming). a. Design the logic for a program that merges the files for summer and winter programs to create a list of the first and last names of all participants for the year in ID number order. b. Modify the program so that if a participant has more than one record, the participant's ID number and name are output only once. c. Modify the program so that if a participant has more than one record, the ID number and name are output only once along with a count of the total number of classes the participant has taken.arrow_forwardI need the answer as soon as possiblearrow_forward
- You have a large data set of an area with income and number of people having that income. You want to create an efficient search system using Binary Search Tree (BST) to search an income and related count. Input to be read from in.txt file: Consider a file (you have to create in.txt file and copy the sample data shown below) with the total number of unique incomes (N) in the first line and next N lines will contain the income and corresponding count of people with that income separated by space. Output: display the result in the console. Do not spend too much time producing the exact output format as we will check the output manually. Tasks: [you have to write a set of functions and test them. Some of them are fairly small] 1. Create a binary search tree based on income as the key. However, you should also store the corresponding count within the BST node. 2. Print the data in the tree in the in-order traversal to see the keys are in sorted order. Print them like comma-separated tuple…arrow_forwardplease use spyderarrow_forwardBella is a psychology student who is carrying out an experiment in which she repeatedly asks people to "think of an object, any object". Bella wants to see what objects people think of under this situation. She enters each object into a text file, one object per line. Help Bella analyse the data by writing a function make_dictionary (filename) that reads the named file and returns a dictionary mapping from object names to occurrence counts (the number of times the particular object was guessed). For example, given a file data.txt containing the following dog triceratops persian cat dog persian cat large white fluffy thing persian cat the function would return the dictionary {'dog': 2, 'triceratops': 1, 'persian cat': 3, 'large white fluffy thing': 1} Notes: • You may assume the given file exists, but it may be empty (i.e., containing no lines). Keys must be inserted into the dictionary in the order in which they appear in the input file. • In some of the tests we display the keys in…arrow_forward
- in C++ solve the following question in the picture :arrow_forwardWrite a program that allows the user to sort using the Heap Sort and Bin/Radix Sort. The program should be able to read in data from a binary file. The first element of the binary file will be used to tell how many elements to read in. Once all the data has been read in, the program should sort the data. The user should be able to choose which algorithm to use to sort the data. The program should print the time before and after the sort. The last part of the program should prompt the user for a lower and upper bound. These two values should then be used to decide how much and which part of the array will be display. Note: The binary files may have duplicate numbers in them. Make sure your sorts are able to handle these cases. Reminder: The implementation of your algorithms must follow the format we cover in class. Bin sort must be constructed yourself using pointers. No vectors, queues, etc..arrow_forwardCreate a C Program for this problem.You are to read 10 numbers from a data file into an array named List. Create another 10 element array named Reverse that is to contain the same items as List but in reverse order. For example, the first element in List will be placed in the last position of Reverse, the second element in List will be placed in the second-to-last position in Reverse, etc. After Reverse has been created, output the contents of both arrays.arrow_forward
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT