hi all, am new here and i have a question in c++ am taking cs1 course , soo am a beginner ..i have an assignment question so plz if any one can solve it to me am thankfull..the question is::
Write a program that finds students who score the highest and lowest average marks of the first two homework in CS (I). Your program should read the data from a file called "hw.txt" and displays the output to another file called results.txt. The first line of the input file contains the number of students, n. The next n lines contain information about each student. Each data line contains the student name (first name and last name) and his/her marks, each out of 30.
The output should display all student names, marks, and grades. In addition your program should calculate and display the highest and lowest marks along with the name of the student. Also, your program should calculate and display all the average and the grade of the entire class. (See sample input/output). Also, see table for assigning letter grades.
A B C D F
(90-100) (80-89) (70-79) (60-69) (Less 60)
If your input file contains:
20
Mohamed Al-Ayoubi 21 18
Hiba Ahmed 22 14
Abeer BentMoussa 24 26
Ahmed Akibah 20 28
Noura Al-Kaabi 23 20
Abdullah Al-Souyaidi 18 28
Khori Abdullah 28 29
Eman Al-Harriri 25 29
Hithem Abu-Falafel 20 27
Aishamel Muqabal 21 20
Mounir Al-Arabi 20 28
HudaAmel Al-Khamissi 21 13
Huda Al-Ourbani 23 23
Mohamed Al-Sheikh 25 29
Rawshan Al-Nawaz 20 28
Saifeddin Al-Hashmi 22 26
Mohamed Al-Kawtahri 26.5 21.5
Abdullah Al-Badilz 19 25
Ibrahim Al-Khaboussi 25 15
Allaa Al-Maliki 29 19
The output should look like:
Student Name Mark1 Mark2 Avg. Mark Grade
--------------------------------------------------------------------------------------------------------------------
Mohamed Al-Ayoubi 21.00 18.00 19.50 D
Hiba Ahmed 22.00 14.00 18.00 D
Abeer BentMoussa 24.00 26.00 25.00 B
.
..
.
..
..
Allaa Al-Maliki 29.00 19.00 24.00 B
The Maximum average mark is: 28.50 Scored by : Khori Abdullah
The minimum average mark is: 17.00 Scored by : HudaAmel Al-Khamissi
The average of the class: 23.29
The Grade of the class: C