Purchase Solution

write a program to calculate the exam grades for a class of a few hundred students

Not what you're looking for?

Ask Custom Question

You will write a program to calculate the exam grades for a class of a few hundred students.

Input
Read the input file into your program as a comand line argument, rather than hardcoding the name as you were allowed to in project 3.

Each student has a last name, first name, and five problem scores (the four problems on the exam and one extra credit problem). Your program should scan students data in from a file and store it in an array of 27 linked lists. Students will be sorted to different lists by the first letter of their last name. So "Hunter, Johnny"
will be sorted to arr[7] list, as H is the 8th letter in the alphabet (remember 'H' - 'A' = 7). The 27th list should store any names that somehow do not start with a letter of the alphabet.

The input file itself is formatted so that each student's entry is one line. All entries are divided by single spaces, so scanning them in should be fairly easy.

You can assume that each students first and last name will consist of at most 20 characters each. I'd prefer that you allocate these strings dynamically, but it isn't a requirement.

Calculating scores
Along with the five problem scores, each student structure should also contain room for a final exam grade. This will be the sum of four of the four exam problems. If the extra credit problem has a higher score than one of the exam problems, then it can be used (only once) to replace that problem score.

So if Johnny's scores were 11, 17, 19, and 5, with an extra credit score of 8,
then his final grade would be 11 + 17+ 19 + 8 = 55 out of a total 80.

However if Sue's scores were 20, 5, 6, and 18, with an extra credit score of 10,
Then her final grade would be 20 +10 + 6 + 18 = 54 out of 80.

So the extra credit problem will replace the lowest problem score. Really much less complicated than I've made it sound.

Output
Print a menu with four options.
The first should prompt for a letter and print the names and final scores for all students whose last names begin with the input letter.

The second option should be to compute the class average.

The third option should prompt for a score number 1-6 and a number of points 0-20.
Score numbers 1-4 correspond to problems 1-4.
Score number 5 corresponds to the extra credit problem.
Score number 6 corresponds to the final grade.

The function you write for this should increment the specified score by the number of points given. Final grades will have to be recalculated in the first five cases, so that function may have to be called again.

The last option should free all allocated memory and exit.

Modification
--------------------------------------------------------------------------------------------------
First off, you can assume a fixed size of 20 characters for first and last names. I would prefer if you dynamically allocated these, but I won't require you to.

Second, I didn't specify how the program should accept its input file (theres
only one file). Do this with command line arguments, rather than hardcoding the
name

Last, expand the functionality a bit. Rather than computing the average for one letter, include a menu with four options.

The first should prompt for a letter and print the names and final scores for all students whose last names begin with the input letter.

The second option should be to compute the class average, rather than the
average for one list.

The third option should prompt for a score number 1-6 and a number of points
0-20.
Score numbers 1-4 correspond to problems 1-4.
Score number 5 corresponds to the extra credit problem.
Score number 6 corresponds to the final grade.

The function you write for this should increment the specified score by the
number of points given. Final grades will have to be recalculated in the first
four cases, so that function may have to be called again.

Attachments
Purchase this Solution

Solution Summary

You will write a program to calculate the exam grades for a class of a few hundred students.

Solution Preview

Please see the attached file.

Please note:
Due to a bug in the <stdio.h> installed in my Linux environment, a character ...

Purchase this Solution


Free BrainMass Quizzes
C++ Operators

This quiz tests a student's knowledge about C++ operators.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Javscript Basics

Quiz on basics of javascript programming language.