Question: Write a program studentDatabase(numStudents) that allows user to specify the number of students with numStudents to input ID numbers and names and stores the information

Write a program studentDatabase(numStudents) that allows user to specify the number of students with numStudents to input ID numbers and names and stores the information using the dictionary data structure. Then, it allows the user to look up a student by their ID number. The program should gracefully exit when the user enters a blank.

Sample Output: >>> studentDatabase(3) >>> Enter id of a new student: 1000 >>> Enter name of the new student: John Garcia

>>> Enter id of a new student: 2000 >>> Enter name of the new student: Lily Lane

>>> Enter id of a new student: 3000 >>> Enter name of the new student: Maria Lee

>>> Enter id to look up: 1000 John Garcia

>>> Enter id to look up: 2000 Lily Lane

>>> Enter id to look up: Have a good day!

>>> |

python

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