Implementation of a common sorting algorithm

Assignment Help C/C++ Programming
Reference no: EM132274689

Description:

For this project, you have been tasked to read a text file with student grades and perform several operations with them. First, you must read the file, loading the student records. Each record (line) contains the student's identification number and then four of the student's numerical test grades. Your application should find the average of the four grades and insert them into the same array as the id number and four grades. I suggest using a 5th array position to hold the computed average. Once the file has been read and the averages calculated and stored in the array, you must sort the list by grade in descending order. Finally, the records should be printed to screen in descending final grade order with statistics at the end of the file for the class average, highest and lowest grades. We will cover the aspects you need to complete this project over the next 3-4 weeks.

Objectives:

• Use of the FILE* and file functions.
• Use of functions to include the passing of arrays and or array elements.
• Implementation of a common (bubble sort) sorting algorithm.
• Display formatted output using input/output statements.
• Use format control strings to format text output.
• Use C data types.

Requirements:

Your program should make use of the following functions.

1. A function to read the file into an array of arrays. This function should take an empty multi-dimensional array from the caller. The function should ask the user for the name of the file. You may assume the file name entered will be accurate and accessible. You may omit this requirement and hard code the path to the file. You will be given a test file (shown below). I suggest hard coding the filename while you develop your project to save typing it over and over while you test.

2. A function to compute the grade for each array/record. This function should access the array and average the test grades, inserting the final average into the last position for each record as a float.

3. A function to sort the array of arrays by final grade in descending order (highest grade first). This function should take the entire array.

4. A function to print out the results of the operation to screen calculating the required totals and formatting the output appropriately. This function should take the entire array as well.

Your program is expected to only deal with fractional values. Therefore, you are required to use a multi-dimensional array of type float or double.

Your program will not have to resize your array; you may hard code the size of the array using a constant (#define). The test files will have 10 records/students, a student number followed by 4 grades. You may not use any global variables save for the use of a constant for array size if you wish as shown often in some examples.

Reference no: EM132274689

Questions Cloud

What other trends or forces might affect marketing : Consider the three key forces (technology, globalization, and social responsibility) driving the new marketing realities. ( in 350 word)
What are some risk factors of being sexually harassed : Should school districts include additional classes or information on sexual harassment, sexual assault, dating violence, and stalking? Why or why not?
Explain the statement with emphasis on home : Write an essay to explain the statement with emphasis on home and host country government policies that facilitate and regulate the international marketing.
How your actions can be consistent with the person you hope : Write a plan for success detailing how your actions can be consistent with the person you hope to be.
Implementation of a common sorting algorithm : Implementation of a common sorting algorithm - compute the grade for each array/record. This function should access the array and average the test grades
Should a department policy be updated with each new case : Many times such civil Liability risks can be handled with confidence gained through well-informed personnel who have been well trained in the topic.
What are some of the specific sort of crimes : Provide some details about your findings. What are some of the specific sort of crimes that cyber criminals commit?
Describe your brand and competitor pricing strategies : Describe your brand's pricing strategies and competitor brand's pricing strategies that are implemented by each category. Give brief examples to show your.
What are the steps to investigating a burglary : What are the steps to investigating a burglary? What types of evidence are usually associated with a burglary?

Reviews

len2274689

4/4/2019 2:12:37 AM

This is a course capstone project, whereby you may use the tools, lessons and modules that we have examined to process a text data file. Many of the functionality in this project have been demonstrated in the modules, such as the bubble sort. You can use those code samples. I will be looking for copied assignments using plagiarism tools, please do your own code/work. You may seek assistance and guidance but this is to make sure you have the skills to move on in the computing major.

Write a Review

C/C++ Programming Questions & Answers

  Consists of an employee''s last name

Each input line consists of an employee's last name, first name, current base salary, total sales and percent commission. For example, in the first input line, the last name of the employee is Thomas, the first name is Andrew, the current base salary..

  Create if-then statement with single alternative decision

Create the If-Then statement (or a flowchart with a single alternative decision structure) which assigns 20 to  variable y and allots 40 to variable z if variable x is greater that 100.

  Write a program that will do the quadratic equation

Write a program that will do the Quadratic Equation. Write a program, using functions, that will print out temperature conversion tables.

  Write a program that fills in an array

Write a program that fills in an array, a, of 25 integers where each element contains the sum of all the previous elements plus 1, e.g., a[0] is 1 and a[3] is equal to a[0] + a[1] + a[2] + 1.

  Write a function named shift_right

The function should make sure that left is less than or equal to right, and that distance is greater than zero. If either of these conditions fails, the function should return the value 1 to indicate an error.

  Program that uses the attached data file as input

Please do this the easiest way possible, I am learning C++ by myself but I just don't understand input/output so this will help me understand it better.

  Prepare a program for a company named retail-martbullprompt

prepare a program for a company named retail-mart.bullprompt the user to enter an item name one word only a quantity

  Write short c program to develops two processes

Write down a short C program which develops two processes. Each process must repeatedly write its own unique message to test file, one character at time. Do you see garbled messages in the file? Explain why or why not?

  Define an array and why you would use one

Define an Array and why you would use one. Provide an example that is not from the text.

  Write a program that creates an array of 200 random numbers

Write a program that creates an array of 200 random real numbers between 0 and 200.  Using the statistics library, calculate and output the following: mean, median, variance, standard deviation, maximum value, and minimum value.

  Write a single program using control structures

For your strength of materials course you wilii write a single program using control structures(including nested loops)and file I/O to explore the deflection of a cantilever beam with a point load at the free end. This is to be on the base on the ..

  Prepare the function reverseit

Prepare the function reverseit that reverses the characters in a character array. You must also write main that calls reverseit.

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