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.
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...
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
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
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.
● 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.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
Recommended textbooks for you
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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
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
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY