Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

An Introduction to Programming with C++

Authors: Diane Zak

8th edition

978-1285860114

More Books

Students also viewed these Programming questions

Question

Echo staff performs exam (23 minutes).

Answered: 1 week ago