CECS 174 Project 5: Calculating Average, Deviation, and Grades with C++, Lab Reports of Computer Science

The specification for cecs 174 project 5, which involves creating a c++ program to calculate the average, standard deviation, and grades of student scores. The program should read in student scores, determine the grade for each score, and keep track of the number of students in each grade category. The grading scale is based on the following scores: a for 90 or above, b for 80 to 89, c for 70 to 79, d for 60 to 69, and f for below 60. The program should also output the number of scores, average score, standard deviation, and the number of students in each grade category.

Typology: Lab Reports

Pre 2010

Uploaded on 08/19/2009

koofers-user-1eu
koofers-user-1eu 🇺🇸

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CECS 174 Project 5 - Due in lab on Tuesday, 11/4/03
One of the difficulties you had in Lab 4 was that the increments you made to a counter in a function seemed to
have no effect in the main function since the counter was a local variable in the function. In this project you are
to solve the problem using reference parameters (DO NOT use global variables). The specification of this
project extends from Project 4 to include finding the standard deviation of the scores. Write a C++ program
that reads in student scores. For each score it reads in, determine if the score is an A, B, C, D, or F, according to
the scale given below. Your program should also keep track of the number of students in each grade category,
and the average and standard deviation of all scores that the user inputs.
Grading scale:
A: score >= 90
B: 80 <= score < 90
C: 70 <= score < 80
D: 60 <= score < 70
F: score < 60
When your program executes, it should produce output as in the following sample dialogue:
Enter all scores below, one score per line. Press control-d when done.
55
Input score is 55.00, grade F
78.5
Input score is 78.50, grade C
98
Input score is 98.00, grade A
77
Input score is 77.00, grade C
80.55
Input score is 80.55, grade B
90
Input score is 90.00, grade A
Number of scores = 6
Average score = 79.84
Standard deviation = 13.30
Grade Number of Students
A 2
B 1
C 2
D 0
F 1
__________________________________________________________________________________________
pf2

Partial preview of the text

Download CECS 174 Project 5: Calculating Average, Deviation, and Grades with C++ and more Lab Reports Computer Science in PDF only on Docsity!

CECS 174 Project 5 - Due in lab on Tuesday, 11/4/

One of the difficulties you had in Lab 4 was that the increments you made to a counter in a function seemed to have no effect in the main function since the counter was a local variable in the function. In this project you are to solve the problem using reference parameters (DO NOT use global variables). The specification of this project extends from Project 4 to include finding the standard deviation of the scores. Write a C++ program that reads in student scores. For each score it reads in, determine if the score is an A, B, C, D, or F, according to the scale given below. Your program should also keep track of the number of students in each grade category, and the average and standard deviation of all scores that the user inputs. Grading scale: A: score >= 90 B: 80 <= score < 90 C: 70 <= score < 80 D: 60 <= score < 70 F: score < 60 When your program executes, it should produce output as in the following sample dialogue: Enter all scores below, one score per line. Press control-d when done. 55 Input score is 55.00, grade F

Input score is 78.50, grade C 98 Input score is 98.00, grade A 77 Input score is 77.00, grade C

Input score is 80.55, grade B 90 Input score is 90.00, grade A Number of scores = 6 Average score = 79. Standard deviation = 13. Grade Number of Students A 2 B 1 C 2 D 0 F 1


C++ Statements Needed :  Declaration for int and double variables.  Predefined math functions.  Input and output (cout << and cin >>).  Loop, controlled by end of input.  if-else statements.  Function for the determination and output of the appropriate grade for a given score. This function should use some reference parameters.


Do the following:  Name your program file lab5.cpp and place it in your 174 subdirectory.  Document your program following the Program Documentation Guide which may be accessed through http://www.cecs.csulb.edu/~lam/cecs174/course-notes.html  Make sure your program’s output matches the sample dialogue given above.  Use script to get a typescript file that captures: a) cat lab5.cpp b) g++ lab5.cpp c) a.out.  Print and hand in a hardcopy of the typescript file.  Demo your program on the due date.