frontendweb development
CSCI 3000 Homework 2
In this homework, you will write a C++ program that calculates student grades for a course. In this course, there are 10 students and there are total of 7 scores for each student. Student’s weighed total score is calculated as follows:
Weighted Total: (0.1*HW1) + (0.1*HW2) + (0.1*HW3) + (0.1*HW4) + (0.15*Test1) + (0.15*Test2) + (0.3*Final)
The semester is not finished yet, and current student grades are given in the following table:
|
|
HW1 |
HW2 |
HW3 |
HW4 |
Test 1 |
Test 2 |
Final Test |
|
Student 0 |
78 |
77 |
55 |
58 |
97 |
61 |
? |
|
Student 1 |
68 |
73 |
55 |
100 |
61 |
73 |
? |
|
Student 2 |
58 |
72 |
77 |
97 |
61 |
63 |
? |
|
Student 3 |
90 |
53 |
66 |
52 |
75 |
85 |
? |
|
Student 4 |
81 |
95 |
60 |
56 |
66 |
95 |
? |
|
Student 5 |
74 |
83 |
87 |
50 |
82 |
74 |
? |
|
Student 6 |
100 |
72 |
67 |
87 |
80 |
80 |
? |
|
Student 7 |
55 |
91 |
80 |
85 |
63 |
90 |
? |
|
Student 8 |
74 |
87 |
79 |
51 |
74 |
71 |
? |
|
Student 9 |
66 |
62 |
62 |
88 |
74 |
85 |
? |
Students did not take the Final exam yet, therefore, the Final column is empty. These grades are provided in the “grades.txt” file, where every row includes grades for one student. In your program, you will read this file and load grades into a two-dimensional (10 by 6) integer array.
The program should start by printing the grades of all students and provide a menu such as:
The user should be able to select one of these menu options:
1) Calculate average of all scores
a. Calculate the average of each column, and print them on the screen.
2) Calculate the Min and Max of all scores
a. Calculate the min and max of each column, and print them on the screen.
3) Calculate Student Current Grade
a. Get a number from the user between 0 and 9 to identify a student. Later, you will calculate the current weighted average score for that student. Here you will ignore the Final test and calculate average without it. Please see the weights formula above.
4) Calculate Min. Final Score for an 80 (B) average
a. Get a number from the user between 0 and 9 to identify a student. Later, you will calculate the minimum Final test score that is necessary for that student to get an average of 80 by the end of the semester. Please see the weights formula above.
Please note that these images are only sample outputs. You are free to use your own output format as long as all options in the menu is available.
On the top of your source code, please add your name and number, Course ID, HW number and the date using a comment block.
Please do not copy your code from someone else’s program. The instructor may use a code comparison program that automatically checks the similarity between different programs. And do not hesitate to contact me if you are having trouble with the homework. I will be more than happy to help you to solve your problem.