Question: Write a program that finds all students who score the highest and lowest average marks of the first two homework in CS (I).Your program should

Write a program that finds all 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 "hw2.dat" and displays the output to another file called "hw2.out" and on the screen. The first line of the input file contains the number of students, N. The next N lines contain information about the students. Each data line contains student name and his/her marks. The output should display all student names, marks, and grades. In addition, you should output the highest and lowest marks and those who earned them along with the average and the grade of the class.

If your input file contains:

20

AliAl-Shikeli80 81

Noora Al-Wardi60 70

AishaAl-Rabani70 78

RuqayaAl-Moqbali70 88

KarimaAl-Rawas63 90

ManalAl-Siyabi88 78

KhalsaAl-Sariri68 89

ImanAl-Zadjali55 99

FarhaAl-Waheibi80 87

AmelMuqabal71 80

Munira Alabri70 88

Amel Khamis91 83

Huda Al-Mukheini83 83

NawalAl-Shikeili75 89

RashaAl-Raidan90 68

SaifAl-Hashmi72 66

Mohamed Al-Kharousi96.5 71.5

Mohammed Al-Badi99 75

IbrahimAl-Mamari85 65

IshaqAl-malki99 90

Then your output should look like:

Student Name Mark1Mark2Avg. MarkGrade

--------------------------------------------------------------------------------------------------------------------

AliAl-Shikeli80.0081.0081.50B

Noorai Al-Wardi60.0070.0065.00D

AishaAl-Rabani70.0078.0074.00C

-----------------------------------------

-----------------------------------------

IshaqAl-malki99.0090.0094.50 A

The Maximum average mark is:........Scored by: .........................

The minimum average mark is:........ Scored by: ..........................

The average of the class:...........

The Grade of the class: ........... 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!