A sample run of your program should look like below. Note that the user’s inputs are highlighted in bold. Enter an input file: proj1_test_case.txt -------------------------------------------------- Course Report Options -------------------------

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question
A sample run of your program should look like below. Note that the user’s inputs are highlighted in
bold.
Enter an input file: proj1_test_case.txt
--------------------------------------------------
Course Report Options
--------------------------------------------------
1. Print in numerical average order
2. Print in first name order
3. Print course statistics
4. Record Finder
Choose any other option to quit.
--------------------------------------------------
Selection: 2
--------------------------------------------------
--------------------------------------------------
Course Report: First Name Order
--------------------------------------------------
Ana 1500 - 80.00 (B) (rank: 3)
Ana 2000 - 100.00 (A) (rank: 1)
Diego 2500 - 50.00 (F) (rank: 5)
Lee 3000 - 80.00 (B) (rank: 3)
Sarah 1000 - 88.05 (B) (rank: 2)
--------------------------------------------------
--------------------------------------------------
Course Report Options
--------------------------------------------------
1. Print in numerical average order
2. Print in first name order
3. Print course statistics
4. Record Finder
Choose any other option to quit.
--------------------------------------------------
Selection: 1
CSS 2A Page 3 of 6
Project 1
 
 
 
 
 
 
 
 
CSS 2A
--------------------------------------------------
--------------------------------------------------
Course Report: Numerical Average Order
--------------------------------------------------
Ana 2000 - 100.00 (A) (rank: 1)
Sarah 1000 - 88.05 (B) (rank: 2)
Ana 1500 - 80.00 (B) (rank: 3)
Lee 3000 - 80.00 (B) (rank: 3)
Diego 2500 - 50.00 (F) (rank: 5)
--------------------------------------------------
--------------------------------------------------
Course Report Options
--------------------------------------------------
1. Print in numerical average order
2. Print in first name order
3. Print course statistics
4. Record Finder
Choose any other option to quit.
--------------------------------------------------
Selection: 3
--------------------------------------------------
Statistics
--------------------------------------------------
Number of students: 5
Class Average: 79.61
Grade Distribution (histogram)
A *
B * * *
C
D
F *
--------------------------------------------------
CSS 2A Page 4 of 6
Project 1
 
 
 
 
 
 
 
 
CSS 2A
--------------------------------------------------
Course Report Options
--------------------------------------------------
1. Print in numerical average order
2. Print in first name order
3. Print course statistics
4. Record Finder
Choose any other option to quit.
--------------------------------------------------
Selection: 4
---------------------------------------------------
Record Finder: Enter the name of a student: Ana
---------------------------------------------------
Name: Ana
ID: 2000
Average: 100.00 (A)
Name: Ana
ID: 1500
Average: 80.00 (B)
--------------------------------------------------
--------------------------------------------------
CSS 2A
Project 1
For this project, you will develop a program named project1.cpp to determine the final
scores, letter grades, and rankings of all students in a course. All records of the course will be
stored in an input file, and a record of each student will include the first name, id, five quiz
scores, two exam scores, and one final exam score. For each student record, your program should
determine the numeric average and letter grade using the following policies:
a. Each quiz is graded on the basis of 10 points. Among the five quizzes, discard the lowest
score and use the remaining four scores for the grade calculation.
b. Each exam graded on the basis of 100 points.
c. The final exam is graded on the basis of 100 points.
d. For the numeric average, the final exam counts for 40 percent, midterms count for 40
percent, and quizzes count for 20 percent, respectively. Any average of 90 or more is an
'A', any average of 80 or more (but less than 90) is a 'B', any average of 70 or more (but
less than 80) is a 'C', any average of 60 or more (but less than 70) is a 'D', and any
average below 60 is a 'F',
In this project, your program should ask a user for an input file name. Then, it should read the
data into your program and store them in a vector of Student type. (For example:
vector<Student> course). Student will be a class you will write, which should have
the following members:
CSS 2A
name
id
average
grade
rank
Student
: string
: int
:
: char
:
int
double
+ Student ()
+ setName (string)
+ setID (int) : void
+ setAverage (double)
+ setGrade (char) : void
+ setRank (int)
: void
+ getName() const : string
: void
: void
+ getID () const : int
+ getAverage () const : double
+ getGrade () const : char
+ getRank () const : int
+print () const : void
Page 1 of 6
Project 1
Transcribed Image Text:CSS 2A Project 1 For this project, you will develop a program named project1.cpp to determine the final scores, letter grades, and rankings of all students in a course. All records of the course will be stored in an input file, and a record of each student will include the first name, id, five quiz scores, two exam scores, and one final exam score. For each student record, your program should determine the numeric average and letter grade using the following policies: a. Each quiz is graded on the basis of 10 points. Among the five quizzes, discard the lowest score and use the remaining four scores for the grade calculation. b. Each exam graded on the basis of 100 points. c. The final exam is graded on the basis of 100 points. d. For the numeric average, the final exam counts for 40 percent, midterms count for 40 percent, and quizzes count for 20 percent, respectively. Any average of 90 or more is an 'A', any average of 80 or more (but less than 90) is a 'B', any average of 70 or more (but less than 80) is a 'C', any average of 60 or more (but less than 70) is a 'D', and any average below 60 is a 'F', In this project, your program should ask a user for an input file name. Then, it should read the data into your program and store them in a vector of Student type. (For example: vector<Student> course). Student will be a class you will write, which should have the following members: CSS 2A name id average grade rank Student : string : int : : char : int double + Student () + setName (string) + setID (int) : void + setAverage (double) + setGrade (char) : void + setRank (int) : void + getName() const : string : void : void + getID () const : int + getAverage () const : double + getGrade () const : char + getRank () const : int +print () const : void Page 1 of 6 Project 1
CSS 2A
So, you will take the information for each student in the file and calculate the numeric average,
letter grade, and ranking of each student.
Here is an example of how you would do the calculation for the following record:
Cati 1000 9.5 9.0 8.5 8.0 8.5 87.0 92.5 86.0
The lowest quiz is 8.0, so the quiz average would be:
(9.5+ 9.0 + 8.5+ 8.5) / 4.0
The first midterm average:
87.0
The second midterm average:
92.5
The final average:
86.0
Final course average would be:
Exam 2: 20% Final: 40%
Quizzes: 20% Exam 1: 20%
88.75 * .20 + 87.0 * 0.20 + 92.5 * 0.20 + 86.0 * .40 = 88.05
= 8.875 * 10 =
After that, your program should display a menu that allows you to print out course report
information. Those options will be:
1. A course report in order of numeric averages (If students have the same average, you
want to print out the student with the lowest ID number first)
88.75
2. A course report in order of first names (If students have the same name, you want to print
out the student with the lowest ID number first)
3.
The statistics of the class, such as the number of students in the course, the average of all
numeric grades, and the distribution of each letter grade. When you display the
distribution of letter grades, you should use a histogram as shown in the sample result
below.
Sample Input File
The following presents a sample input data file.
Sarah
4. The last option will be a "record finding" function. In other words, if a user enters a first
name, your program should provide information about the student if a student with that
name exists. If there are several students with the same name, your program should
display all their records.
CSS 2A
Ana
Lee
Ana
Diego
1000 9.5 9.0 8.5 8.0 8.5 87.0 92.5 86.0
2000 10.0 6.7 10.0 10.0 10.0 100.0 100.0 100.0
3000 6.9 8.0 8.0 8.0 8.0 80.0 80.0 80.0
1500 8.0 9.0 7.0 6.5 8.0 83.0 77.0 80.0
5.0 5.0 5.0 3.5 5.0 50.0 50.0 50.0
2500
Page 2 of 6
Project 1
Transcribed Image Text:CSS 2A So, you will take the information for each student in the file and calculate the numeric average, letter grade, and ranking of each student. Here is an example of how you would do the calculation for the following record: Cati 1000 9.5 9.0 8.5 8.0 8.5 87.0 92.5 86.0 The lowest quiz is 8.0, so the quiz average would be: (9.5+ 9.0 + 8.5+ 8.5) / 4.0 The first midterm average: 87.0 The second midterm average: 92.5 The final average: 86.0 Final course average would be: Exam 2: 20% Final: 40% Quizzes: 20% Exam 1: 20% 88.75 * .20 + 87.0 * 0.20 + 92.5 * 0.20 + 86.0 * .40 = 88.05 = 8.875 * 10 = After that, your program should display a menu that allows you to print out course report information. Those options will be: 1. A course report in order of numeric averages (If students have the same average, you want to print out the student with the lowest ID number first) 88.75 2. A course report in order of first names (If students have the same name, you want to print out the student with the lowest ID number first) 3. The statistics of the class, such as the number of students in the course, the average of all numeric grades, and the distribution of each letter grade. When you display the distribution of letter grades, you should use a histogram as shown in the sample result below. Sample Input File The following presents a sample input data file. Sarah 4. The last option will be a "record finding" function. In other words, if a user enters a first name, your program should provide information about the student if a student with that name exists. If there are several students with the same name, your program should display all their records. CSS 2A Ana Lee Ana Diego 1000 9.5 9.0 8.5 8.0 8.5 87.0 92.5 86.0 2000 10.0 6.7 10.0 10.0 10.0 100.0 100.0 100.0 3000 6.9 8.0 8.0 8.0 8.0 80.0 80.0 80.0 1500 8.0 9.0 7.0 6.5 8.0 83.0 77.0 80.0 5.0 5.0 5.0 3.5 5.0 50.0 50.0 50.0 2500 Page 2 of 6 Project 1
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L