Question
1. (20 points) Develop a C++ program named hw2.cpp that reads a data file holding the records of students id and scores of two exams.
1. (20 points) Develop a C++ program named hw2.cpp that reads a data file holding the records of students id and scores of two exams. Your program should determine the numeric average and letter grade of each student (there will be 30 students, at most). Then, your program should print out the students arranged from highest numeric average, to lowest. The output should go back to the console, not a file. You should create a struct to hold the students id, numeric average, and letter grade. Furthermore, you are to use an array to hold this data. Note, you will not have an array within your struct declaration. The following shows a sample input data file. Please note that the file has the number of students as the first line. Sample Input File 5 1000 87.0 92.5 2000 100.0 100.0 3000 79.0 81.0 4000 99.0 98.5 5000 65.0 61.9 A sample run of your program might look like this. Note that the users input are highlighted in bold. Sample Execution Enter an input file: C:/CSS2A/input.txt ---------------------------------------------- Course Report ---------------------------------------------- 2000 - 100.00 (A) 4000 98.75 (A) 1000 - 89.75 (B) 3000 - 80.00 (B) 5000 63.45 (D) ---------------------------------------------- CSS2A Page 1 of 2 Homework 2 CSS 2A Your program will be graded based on 1. Compilation without error. 2. Correct output result. 3. Good programming structure such as indentation and blank line to improve readability. 4. Comments. (Title, Abstract, Author, and Date are mandatory.) If you have functions in your program, you also need to provide the abstract of each function. 5. Meaningful and related variable names.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started