Question: In Python, show W e write a python program that reads a text fi le consisting of each students GPA followed by the students name.

In Python, show

We write a python program that reads a text file consisting of each students GPA followed by the students name. The program then prints the highest GPA and the names of all of the students who received that GPA. The program scans the input file only once. Moreover, we assume that there is a maximum of 100 students in the class.

Input The program reads an input file consisting of each students GPA, followed by the students name. Sample data is as follows:

3.4 Randy

3.2 Kathy

2.5 Colt

3.4 Tom

3.8 Ron

3.8 Mickey

3.6 Peter

Output

a. The highest GPA and all of the names associated with the highest GPA. For example, for the above data, the highest GPA is 3.8, and the students with that GPA are Ron and Mickey.
b. List the students sorted descending on their GPAs.

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 Programming Questions!