python
There was a mistake in entering grades on Canvas. We need your help writing a Python script that can help us maintain the class roster. The functionalities you need to implement are explained below. For each of the functionalities, you may want to implement a separate function.
Adding a student to the roster:
When you receive the add NAME GRADE command, you need to add one student with the name NAME and the grade GRADE to the roster. For example, add Simon 20 will add Simon to the roster and his grade will be 20. If the entered grade was greater than 100, or if the students name is already on the roster, then dont add the student to the roster and instead print Failed to add NAME, with NAME being the name of the student you were asked to add to the roster. If adding the student was successful, you will print Added NAME, with NAME being the name of the student you just added.
Updating the grade of an existing student:
When you receive the update NAME GRADE command, you will have to check if the student with the name NAME exists in the roster and if the new grade entered is greater than 100. If the name exists in the roster and if the new grade is not greater than 100, update their grade to GRADE and print Updated NAMEs grade with NAME being the name of the student. Otherwise, if the name doesn’t exist in the roster, print NAME does not exist in the roster or print “Failed to update NAME’s grade” if the grade is greater than 100.
Printing the roster:
When you receive the print command, you need to print the entire roster in the output in the same order that you added students to the roster. For example, if we have {Narges: 0, Benedict: 1} on our roster, it will print: Narges: 0 Benedict: 1
Removing a student from the roster:
When you receive the remove NAME command, you will have to check if the student with the name Name exists in the roster. If so, delete the name from the roster and print Removed NAME with NAME being the name of the student. If the student doesnt exist in the roster, then print “NAME does not exist in the roster
Exiting the program:
When you receive the exit command, you will terminate the program and stop receiving inputs from the user.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.