Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create 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

Create 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!

>>> |

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

Step: 3

blur-text-image

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

Microsoft Visual C# An Introduction to Object-Oriented Programming

Authors: Joyce Farrell

7th edition

978-1337102100

More Books

Students also viewed these Algorithms questions