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
Is there such a thing as an ethical reason for unauthorized access into a computer system?
Anastaziya [24]
Of course there is. On a simple level, consider a parent trying to locate their missing child. Someone might break into their social media accounts to see if there are messages that might help determine their whereabouts.

Consider a website hosting inappropriate pictures of children. Breaking into the server hosting the files and removing them is 100% ethical. 

I'm sure you can think of more examples. 
7 0
3 years ago
Difference between a software package and Integrated software and why users would choose one over the other
ivolga24 [154]

Answer:

Software Package means software which is used collectively, implements alike purposes, or combines alike characteristics and is bundled collectively being one kit from software applications, where as, Integrated software is a combination of software specifically built to operate on almost linked applications.

Explanation:

Users should choose Software Package because of the following reasons:

  • Cheap price compared over buying individual application independently.
  • Opportunity to introduce the total of the applications at the corresponding period or just that applications you require to work.
  • The compatible user interface of individual application over another.
  • The facility to distribute data among applications.
  • Coming updates can refresh every application whole by the corresponding event.
  • Perfect for individual use, licensed use, huge or little company.
  • Every software holds the full-featured transcription.
5 0
3 years ago
What is the impedance mismatch problem? Which of the three programming
kykrilka [37]

Answer:

The problem that created due to the difference in the model of programming language and the database model.

Explanation:

The practical relational model has three components which are as follows

1. Attributes

2. Datatypes

3. Tuples

To minimize this problem  

1. We switch low pass L-Network to high pass L-network

2. We switch high pass L-Network to low pass L-network

3. We use the impedence matching transformer

3 0
4 years ago
Which of the following is a list of input devices?
charle [14.2K]
The Correct answer would be C. <span>microphone,mouse,scanner

microphone you talk into to give info (data)

a mouse you use to click on objects  to give input 

a scanner you input a paper/object 

hope this helps!! :)


</span>
7 0
3 years ago
Which of the following is an example of an open-ended question?
Tpy6a [65]

Answer:

<em>What are your thoughts about this?</em>

Explanation:

A question that can be answered with yes or no is a closed question.

4 0
3 years ago
Other questions:
  • Instructions
    12·1 answer
  • If there are 1 to 30 rows the program should: Calculate and display the average of all of values read into the array Calculate a
    6·1 answer
  • Why is outfitting a workspace with video games in technology development company considered a strategic use of money
    8·2 answers
  • Gina is driving her car down the street. She has a teddy bear sitting on the back seat. A dog runs in front of Gina's car, so sh
    15·2 answers
  • Determine the number of cache sets (S), tag bits (t), set index bits (s), and block offset bits (b) for a 1024-byte 4-way set as
    5·1 answer
  • ___________ is a technique that uses IT to develop an ongoing relationship with the purchasers or buyers of an organization's pr
    13·1 answer
  • what program searches the Internet for specified keywords and returns a list of the pages where the keywords were found
    6·1 answer
  • Swapping two input integers if they are not the same. (use switch-case
    10·1 answer
  • Liam is at the park an would like to play soccer. He tell another kid at the park that he would hurt him if he couldn't play soc
    10·2 answers
  • Xbox one is not turning on and power brick is orange why is that?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!