For this assignment, you will implement a Student Manager for CS department. This program will allow the user to store information about students in CS department, their GPA and number of Passed Units, and allow them to search, edit or sort the information. Your program should be a function called Student Manager() that takes no arguments and returns no values. The Student Manager should be capable of accepting commands from the user and responding to those commands. Your function must print out a prompt to indicate that the user can enter a command. The prompt should be a '$' character. At the prompt, the user will type a command followed by the required arguments. Your program will then perform the specified action. Your program will then print the prompt character '$' again informing the user that they can type in a new command. The program will continuously ask for commands and execute them until the user enters the "quit" command which will terminate your program. The following commands must be supported: 1. AddStudent: This command will allow the user to add a student to the student manager. It takes 4 arguments: first name of the student, last name of the student, GPA (0-4) of the student, and number of passed units (0-100) of the student. These 4 arguments are separated by commas. This command creates a new student and records their information in the Student Manager. The students are maintained in order based on when they are entered, so a newly entered student is always added at the end of the ordering. The ordering can only be changed using the SortRoster command described below. 2. DeleteStudent: This command allows the user to remove a student from the Student Manager. This command takes 2 arguments, the first name of the student and their last name. These arguments are again separated by commas. This command must print an error message if the student has not already been added to the student manager. On success, it prints nothing. 3. PrintRoster: This command prints the details of all the students that are currently added to the Student Manager. This command takes in no additional arguments. Your program should print information of one student per line, each item of information separated by commas. Student information should be printed in the order maintained by the Student Manager. Information about each student should be printed on a line in the following order: first name, last name, GPA and number of passed units.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Example Output
The following output is an example of how your program should respond to the
commands. The text in bold is the user-typed input.
>>> StudentManager()
$ AddStudent John, Doe, 3.7, 32
$ AddStudent Jean, Davis, 3.8, 24
$ AddStudent Aaron, Johnson, 3.6, 16

$ AddStudent John, Schwartzmann, 3.9, 28
$ PrintRoster
John, Doe, 3.7, 32
Jean, Davis, 3.8, 24
Aaron, Johnson, 3.6, 16
John, Schwartzmann, 3.9, 28
$ SortRoster Name
Aaron, Johnson, 3.6, 16
Jean, Davis, 3.8, 24
John, Doe, 3.7, 32
John, Schwartzmann, 3.9, 28
$ SortRoster GPA
John, Schwartzmann, 3.9, 28
Jean, Davis, 3.8, 24
John, Doe, 3.7, 32
Aaron, Johnson, 3.6, 16
 
 
 
 
 
 
 
$ SortRoster Units
John, Doe, 3.7, 32
John, Schwartzmann, 3.9 ,28
Jean, Davis, 3.8, 24
Aaron, Johnson, 3.6, 16

$ DeleteStudent Julia, Taylor
Error! No student with that name was found in the roster.
$ DeleteStudent Aaron, Johnson
$ PrintRoster
John, Doe, 3.7, 32
John, Schwartzmann, 3.9, 28
Jean, Davis, 3.8, 24
$ FindByFName John
John, Doe, 3.7, 32
John, Schwartzmann, 3.9, 28
$ FindByLName Davis
Jean, Davis, 3.8, 24
$ GetAverage GPA

3.7952
$ GetAverage Units

28

$ Quit

 
 
 
 
 
 
 
Additional Details
● The information about each student must be stored internally as a namedtuple
called Student which contains all the information related to the student. The
namedtuple must have 4 fields: First name of the student, last name of the
student, their GPA and their number of passed units.
● Your program must maintain a list called StudentRoster which contains all of
the student namedtuples which are currently in the manager.
● The AddStudent command must add a namedtuple to the StudentRoster, and
DeleteStudent must remove a namedtuple from the StudentRoster.
● The commands specified above and the arguments are case-sensitive.
● If the user mistypes the command or enters a command which is not valid, your
program should not crash. Instead your program should ignore that command
without changing the state of the student roster and instead print a new prompt to
the user.
● Each function that you define must have a docstring explaining briefly what the
purpose of that function is.
4. SortRoster: This command allows you to sort the list of students. The
command takes in only one additional argument. This argument can be
"Name" or "GPA" or "Units". If the argument is "Name", your program
must sort this list of students alphabetically according to first name, and
using second name as the sort key if the first names are the same. If the
argument is "GPA", then your program must sort this list of students by
decreasing order of their GPA. If the argument is "Units", then your
program must sort the list of students by decreasing order of the number
of passed units of the students. Finally, after sorting, your program
should print out the sorted list of students in the same format as the
command PrintRoster.
5. FindByFName: This command allows the user to look up students by
their first name. This command takes in 1 argument, the first name of the
student the user is trying to search. If the student is in the manager, the
student information must be printed in a single line with items of
information separated by commas. Additionally, if there are multiple
students with the same first name, the command should print information
for all students with the matching first name.
6. FindByLName: This command allows the user to look up students by
their last name. This command takes in 1 argument, the last name of the
student the user is trying to search. If the student is in the manager, the
student information must be printed in a single line with items of
information separated by commas. Additionally, if there are multiple
students with the same last name, the command should print information
for all students with the matching last name.
7. GetAverage: This command allows the user to get the average of the
GPA or the number of passed units of all students. It takes in 1
argument, "GPA" or "Units". If the argument is "GPA", your program
should calculate the average of the students' GPA weighted with the
number of passed units of all students added to the student manager
and then print this number. If the argument is "Units", your program
should calculate the average number of passed units of all students
added to the student manager and then print this number.
8. Quit: This command terminates the program.
Transcribed Image Text:4. SortRoster: This command allows you to sort the list of students. The command takes in only one additional argument. This argument can be "Name" or "GPA" or "Units". If the argument is "Name", your program must sort this list of students alphabetically according to first name, and using second name as the sort key if the first names are the same. If the argument is "GPA", then your program must sort this list of students by decreasing order of their GPA. If the argument is "Units", then your program must sort the list of students by decreasing order of the number of passed units of the students. Finally, after sorting, your program should print out the sorted list of students in the same format as the command PrintRoster. 5. FindByFName: This command allows the user to look up students by their first name. This command takes in 1 argument, the first name of the student the user is trying to search. If the student is in the manager, the student information must be printed in a single line with items of information separated by commas. Additionally, if there are multiple students with the same first name, the command should print information for all students with the matching first name. 6. FindByLName: This command allows the user to look up students by their last name. This command takes in 1 argument, the last name of the student the user is trying to search. If the student is in the manager, the student information must be printed in a single line with items of information separated by commas. Additionally, if there are multiple students with the same last name, the command should print information for all students with the matching last name. 7. GetAverage: This command allows the user to get the average of the GPA or the number of passed units of all students. It takes in 1 argument, "GPA" or "Units". If the argument is "GPA", your program should calculate the average of the students' GPA weighted with the number of passed units of all students added to the student manager and then print this number. If the argument is "Units", your program should calculate the average number of passed units of all students added to the student manager and then print this number. 8. Quit: This command terminates the program.
For this assignment, you will implement a Student Manager for CS department.
This program will allow the user to store information about students in CS department,
their GPA and number of Passed Units, and allow them to search, edit or sort the
information. Your program should be a function called Student Manager() that takes
no arguments and returns no values.
The Student Manager should be capable of accepting commands from the user
and responding to those commands. Your function must print out a prompt to indicate
that the user can enter a command. The prompt should be a '$' character. At the
prompt, the user will type a command followed by the required arguments. Your
program will then perform the specified action. Your program will then print the prompt
character '$' again informing the user that they can type in a new command. The
program will continuously ask for commands and execute them until the user enters the
"quit" command which will terminate your program.
The following commands must be supported:
1. AddStudent: This command will allow the user to add a student to the
student manager. It takes 4 arguments: first name of the student, last
name of the student, GPA (0-4) of the student, and number of passed
units (0-100) of the student. These 4 arguments are separated by
commas. This command creates a new student and records their
information in the Student Manager. The students are maintained in
order based on when they are entered, so a newly entered student is
always added at the end of the ordering. The ordering can only be
changed using the SortRoster command described below.
2. DeleteStudent: This command allows the user to remove a student from
the Student Manager. This command takes 2 arguments, the first name of
the student and their last name. These arguments are again separated by
commas. This command must print an error message if the student has
not already been added to the student manager. On success, it prints
nothing.
3. PrintRoster: This command prints the details of all the students that are
currently added to the Student Manager. This command takes in no
additional arguments. Your program should print information of one
student per line, each item of information separated by commas.
Student information should be printed in the order maintained by the Student
Manager. Information about each student should be printed on a line in the
following order: first name, last name, GPA and number of passed units.
Transcribed Image Text:For this assignment, you will implement a Student Manager for CS department. This program will allow the user to store information about students in CS department, their GPA and number of Passed Units, and allow them to search, edit or sort the information. Your program should be a function called Student Manager() that takes no arguments and returns no values. The Student Manager should be capable of accepting commands from the user and responding to those commands. Your function must print out a prompt to indicate that the user can enter a command. The prompt should be a '$' character. At the prompt, the user will type a command followed by the required arguments. Your program will then perform the specified action. Your program will then print the prompt character '$' again informing the user that they can type in a new command. The program will continuously ask for commands and execute them until the user enters the "quit" command which will terminate your program. The following commands must be supported: 1. AddStudent: This command will allow the user to add a student to the student manager. It takes 4 arguments: first name of the student, last name of the student, GPA (0-4) of the student, and number of passed units (0-100) of the student. These 4 arguments are separated by commas. This command creates a new student and records their information in the Student Manager. The students are maintained in order based on when they are entered, so a newly entered student is always added at the end of the ordering. The ordering can only be changed using the SortRoster command described below. 2. DeleteStudent: This command allows the user to remove a student from the Student Manager. This command takes 2 arguments, the first name of the student and their last name. These arguments are again separated by commas. This command must print an error message if the student has not already been added to the student manager. On success, it prints nothing. 3. PrintRoster: This command prints the details of all the students that are currently added to the Student Manager. This command takes in no additional arguments. Your program should print information of one student per line, each item of information separated by commas. Student information should be printed in the order maintained by the Student Manager. Information about each student should be printed on a line in the following order: first name, last name, GPA and number of passed units.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY