UMBC CMSC 104 CSEE | 104 | current 104

CMSC104, Fall 2008

Programming Project 1

Grade Calculation Program

Out: Wednesday, October 15, 2008
Due: Wednesday, October 22, 2008 before 11:59 p.m.


The Objective

This project is designed to give you practice writing a C program on your own. You will also gain experience taking pseudocode you have written and writing the corresponding code.

The Task

Your job is to write a grade calculating program for CMSC104. If you got a good grade on the pseudocode portion of your answer for question 2 of Homework 2, you can use that as the basis for this assignment. If you: got a poor grade; got a good grade but felt is was just luck, because you didn't understand it at all; or was just bored and wanted a fresh start, I have attached a sample pseudocode solution at the bottom of this page which you can use as your starting point. However, if you will be starting from my provided pseudocode, make sure you pay attention to the instructions attached to it

Two important changes to what you might have done for HW2: First, in this project, you do not have to do any error checking of user input. Second, in addition to printing the average, you should also determine the letter grade that corresponds to the numerical average based on the following scale:

     90% <= A <= 100% 
     80% <= B <   90% 
     70% <= C <   80% 
     60% <= D <   70% 
      0% <= F <   60%
When figuring the letter grade, you should round the number up if the decimal portion is .5 and above.

Sample Output

linux2[14]% gcc -ansi -Wall proj1.c

linux2[15]% a.out

Welcome to the CMSC104 grade calculation program. This
program will calculate the final average and course
grade for a student in CMSC104. Each homework is
worth 4%, each project is worth 7% and each exam is
worth 20%.

Enter the homework 1 score: 100
Enter the homework 2 score: 80
Enter the homework 3 score: 100
Enter the project 1 score: 75
Enter the project 2 score: 90
Enter the project 3 score: 99
Enter the project 4 score: 100
Enter the exam 1 score: 92
Enter the exam 2 score: 80
Enter the exam 3 score: 81


With an average of 87.28, your course grade is a B.

Thank you for using the grade calculation program!

linux2[16]% a.out

Enter the homework 1 score: 100
Enter the homework 2 score: 50
Enter the homework 3 score: 75
Enter the project 1 score: 75
Enter the project 2 score: 70
Enter the project 3 score: 75
Enter the project 4 score: 75
Enter the exam 1 score: 80
Enter the exam 2 score: 70
Enter the exam 3 score: 65


With an average of 72.65, your course grade is a C.

Thank you for using the grade calculation program!

linux2[17]%

Submitting the Program

Your program should be in a file called proj1.c.

Here is a sample submission command. Note that the project name starts with uppercase 'P'.

submit cs104_0101 Proj1 proj1.c

To verify that your project was submitted, you can execute the following command at the Unix prompt. It will show the file that you submitted in a format similar to the Unix 'ls' command.

submitls cs104_0101 Proj1




Sample version of the generic algorithm:

Important notes:

Display "Enter the homework 1 score:" Read <h1> Display "Enter the homework 2 score:" Read <h2> Display "Enter the homework 3 score:" Read <h3> Display "Enter the project 1 score:" Read <p1> Display "Enter the project 2 score:" Read <p2> Display "Enter the project 3 score:" Read <p3> Display "Enter the project 4 score:" Read <p4> Display "Enter the exam 1 score:" Read <e1> Display "Enter the exam 2 score:" Read <e2> Display "Enter the exam 3 score:" Read <e3> <hPoints> = (<h1> + <h2> + <h3>) * .04 <pPoints> = (<p1> + <p2> + <p3> + <p4>) * .07 <ePoints> = (<e1> + <e2> + <e3>) * .20 <final> = <hPoints> + <pPoints> + <ePoints> Display "The the course is", <final>