Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Computing I Program 3 – Treat this like a take home exam. You may not work together. Write a program to compute average grades for a course. The course records are in a single file and are organized...

1 answer below »
Computing I Program 3 – Treat this like a take home exam. You may not work together. Write a program to compute average grades for a course. The course records are in a single file and are organized according to the following format: Each line contains a student’s first name, then one space, then the student’s last name, then one space, then some number of quiz scores that, if they exist, are separated by one space. Each student will have zero to ten scores, and each score is an integer not greater than 100. Your program will read data from this file and write its output to a second file.
Document Preview:

Computing I Program 3 – Treat this like a take home exam. You may not work together. Write a program to compute average grades for a course. The course records are in a single file and are organized according to the following format: Each line contains a student’s first name, then one space, then the student’s last name, then one space, then some number of quiz scores that, if they exist, are separated by one space. Each student will have zero to ten scores, and each score is an integer not greater than 100. Your program will read data from this file and write its output to a second file. The data in the output file will be nearly the same as the data in the input file except that you will print the names as last_name, first_name and there will be one additional number at the end of each line: the average of the student’s ten quiz scores. The output file must be formatted such that first and last names appear together in a left justified column that is 20 characters wide where the last name comes first, then a comma and a space and then the first name. Use your read string function to read each name separately and then put them together into a larger correctly formatted string before trying to output them. Each quiz score should be listed in a right justified column that is 4 characters wide, and the average should appear in its own right justified column that is 10 characters wide. Note that if a student has fewer than 10 scores, the average is still the sum of the quiz scores divided by 10; these students are assumed to have missed one or more of the quizzes. The output file should contain a line (or lines) at the beginning of the file providing appropriate column headings. Use formatting statements to make the layout clean and easy to read. After writing the required data to an output file, your program will close all files and then copy the contents of the “output” file to the “input” file by reopening the input...

Answered Same Day Dec 24, 2021

Solution

Robert answered on Dec 24 2021
115 Votes
Data Collection and Analysis Company

#include
#include
#include char* read_string(char* buff, int maximum_size, FILENAME* za);
int main(int argumentc, char *argumentv[])
{
FILENAME *za_input, *za_output;
int num1, number_of_conversions, total_exams = 10, i = 0, count = 0;
double sum = 0;
char c;
char name1[]="Mitchell Hohn";
char whitespace=' ';
char* buff;
const int SIZE_OF_BUFFER = 30;
buffer = (char*) malloc(SIZE_OF_BUFFER * sizeof(char));
za_input=fopen("scores.txt","w");
fprintf(za_input,name1);
fprintf(za_input," 10 3 2 5 9...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here