1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Elina [12.6K]
3 years ago
7

Write a Python program that creates a dictionary containing course numbers and the room numbers of the rooms where the course me

ets. The dictionary should have the following key-value pairs: Course Number (key) Room Number (value) CS101 3004 CS102 4501 CS103 6755 NT110 1244 CM241 1411 The program should also create a dictionary containing course numbers and the names of the instructors that teach that course. The dictionary should have the following key-value pairs: Course Number (key) Instructor (value) CS101 Haynes CS102 Alvarado CS103 Rich NT110 Burke CM241 Lee The program should also create a dictionary containing course numbers and the meeting times for each course. The dictionary should have the following key-value pairs: Course Number (key) Meeting Time (value) CS101 8:00 am CS102 9:00 am CS103 10:00 am NT110 11:00 am CM241 1:00 pm The program should let the user enter a course number, then it should display the course’s room number, instructor, and meeting time. Ask the user multiple times until he or she decides to exit (y / n).
Computers and Technology
1 answer:
alisha [4.7K]3 years ago
6 0

Answer:

Following are the program in the Python Programming Language:

#set dictionary

rooms ={}

rooms.update({'CS101' : 3004})

rooms.update({'CS102' : 4501})

rooms.update({'CS103' : 6755})

rooms.update({'NT110' : 1244})

rooms.update({'CM241' : 1411})

#set dictionary

instructors={}

instructors.update({'CS101' : 'Haynes'})

instructors.update({'CS102' : 'Alvarado'})

instructors.update({'CS103' : 'Rich'})

instructors.update({'NT110' : 'Burke'})

instructors.update({'CM241' : 'Lee'})

#set dictionary

time={}

time.update({'CS101' : '8:00 a.m'})

time.update({'CS102' : '9:00 a.m'})

time.update({'CS103' : '10:00 a.m'})

time.update({'NT110' : '11:00 a.m'})

time.update({'CM241' : '1:00 p.m'})

while True:

 n=input("You want to continue(y/n): ")

 if(n=="n"):

   break

 else:

   cours=input('Enter a course number: ')

   try:

     print()

     print("Room Number: ", rooms[cours])

     print("Instructors: ",instructors[cours])

     print("Meeting time: ", time[cours])

   except KeyError:

     print("Invalid")

<u>Output</u>:

You want to continue(y/n): y

Enter a course number: CS101

Room Number:  3004

Instructors:  Haynes

Meeting time:  8:00 a.m

You want to continue(y/n): y

Enter a course number: NT1244

Invalid

You want to continue(y/n): y

Enter a course number: NT110

Room Number:  1244

Instructors:  Burke

Meeting time:  11:00 a.m

You want to continue(y/n): n

Explanation:

Here we define three dictionary type variables "rooms", "instructors", "time"

and assign value in these dictionaries by the update() method.

Then, we set the while loop inside it:

  • set a variable "n" and get input from the user.
  • set the if conditional statement and pass the condition is the variable "n" is equal to the value "n" then, loop is break otherwise,
  • we get an input from the user in the variable "cours" and apply try block inside it, we print "room number", "Instructor", "Meeting time" as given in the output and in except block it print "Invalid".

You might be interested in
If you want three vertical sections of text on your page, create _____. dividers columns page breaks bulleted lists
ElenaW [278]

the answer to this question will be Columns

8 0
3 years ago
Read 2 more answers
Releasing refrigerator R -12 into the atmosphere is a criminal offense. A)true B) false
Anika [276]

The answer is true where I live you cant release anything of the sort into the atmosphere

6 0
3 years ago
Read 2 more answers
Elena wrote the following code in Scratch to have the sprite move and then turn around. However, the code does not work as expec
alexgriva [62]

There are a lot of ways to code in Scratch.  What should be done to fix the error is to Change "move 20 steps" to "move 10 steps"

<h3>What is Movement in gaming?</h3>

Movement is known to be a basic function in any kind of game. It is known to be the first thing one has to do when a person start a new game, and  it can be found in almost all of every game that is made in Scratch.

The movement in games is done by pressing the arrow keys, which tells player's characters to move around on the screen and achieve a given task.

Learn more about coding from

brainly.com/question/22654163

8 0
2 years ago
The Painting Company has determined that for every 112 square feet of wall space:
LUCKY_DIMON [66]

Answer:

Answered below

Explanation:

#Program is written in Python.

sq_feet = int(input ("Enter paint area by square feet: ")

gallons = float(input (" Enter number of gallons: ")

paint_job_cost(sq_ft, gallons)

#Function

def paint_job_cost(sq_ft, gal){

gallon_cost = 0

cost_per_hour = 35

if sq_ft <= 2000:

 gallon_cost = 9.53

else:

gallon_cost = 10.50

paint_cost = gal * gallon_cost

labour_hours = 8 * (sq_ft/112)

total_labour_cost = labour_hours * cost_per_hour

hazard_fee = 0.075 * paint_cost

total_cost = paint_cost + total_labour_cost + hazard fee

print (paint_cost)

print(labour_hours)

print (total_labour_cost)

print (hazard_fee)

print(total_cost)

}

5 0
3 years ago
How do you join The Meeting on zoom because I have class Tomorrow with My Teacher
Svetllana [295]

Answer:

Go to join.zoom.us. Enter your meeting ID provided by the host/organizer. Click Join. When asked if you want to open zoom.us, click Allow.

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Résumés for teenagers and young adults typically consist of<br> (Apex)
    11·2 answers
  • How do you leave a conversation or group text on iphone (ios 10)? Help!!
    5·1 answer
  • The SmoothWall open source firewall solution uses colors to differentiate networks. Which color indicates the private, trusted s
    9·1 answer
  • HELP WILL GIVE BRAINIEST IF YOU HELP ME.....
    8·2 answers
  • When was the federal commission act put into effect?????
    13·1 answer
  • Analyze the following code.
    10·1 answer
  • Nancy finds it difficult to locate emails in her Inbox. What action should she take to locate a particular type of email instant
    10·1 answer
  • Is it true or false 1-5
    13·1 answer
  • To print photographs in color.​
    7·1 answer
  • the implications your organization of providing email facilities to individuals in the workplace in terms of security and virus
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!