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
Firlakuza [10]
3 years ago
12

Write a C++ program that creates a map containing course numbers and the room numbers of the rooms where the courses meet. The d

ictionary should have the following key-value pairs:
Course Number (key) Room Number (value)
CS101 3004
CS102 4501

The program should also create a map containing course numbers and the names of the instructors that teach each course. The map should have the following key-value pairs:

Course Number (key) Instructor (value)
CS101 Haynes
CS102 Alvarado

The program should also create a map containing course numbers and the meeting times of each course. The map should have the following key-value pairs:

Course Number (key) Meeting Time (value)
CS101 8:00am
CS102 9:00am

The program should let the user enter a course number, and then it should display the course's room number, instructor, and meeting time.
Computers and Technology
1 answer:
swat323 years ago
7 0

Answer:

Program approach:-

  • Using the necessary header file.
  • Using the standard namespace I/O.
  • Define the integer main function.
  • Mapping course numbers and room numbers.

Explanation:

//header file

#include<iostream>

#include<map>

//using namespace

using namespace std;

//main function

int main(){

               //creating 3 required maps

               map <string,int> rooms;

               map <string,string> instructors;

               map <string,string> times;

               //mapping course numbers and room numbers

               rooms.insert(pair<string,int>("CS101",3004));

               rooms.insert(pair<string,int>("CS102",4501));

               //mapping course numbers and instructor names

               instructors.insert(pair<string,string>("CS101","Haynes"));

               instructors.insert(pair<string,string>("CS102","Alvarado"));

               //mapping course numbers and meeting times

               times.insert(pair<string,string>("CS101","8:00am"));

               times.insert(pair<string,string>("CS102","9:00am"));

               

               char choice='y';

               //looping until user wishes to quit

               while(choice=='y' || choice=='Y'){

                               cout<<"Enter a course number: ";

                               string course;

                               cin>>course;//getting course number

                               //searching in maps for the required course number will return

                               //an iterator

                               map<string, int>::iterator it1=rooms.find(course);

                               map<string, string>::iterator it2=instructors.find(course);

                               map<string, string>::iterator it3=times.find(course);

               

                               if(it1!=rooms.end()){

                                               //found

                                               cout<<"Room: "<<it1->second<<endl;

                               }else{

                                               //not found

                                               cout<<"Not found"<<endl;

                               }

               

                               if(it2!=instructors.end()){

                                               cout<<"Instructor: "<<it2->second<<endl;

                               }

               

                               if(it3!=times.end()){

                                               cout<<"Meeting Time: "<<it3->second<<endl;

                               }

                               //prompting again

                               cout<<"\nDo you want to search again? (y/n): ";

                               cin>>choice;

               }

You might be interested in
Select the correct text in the passage.
MatroZZZ [7]

Answer:

Answer:Veronica works as an executive in a marketing company.

Explanation:

Today, she has to make a presentation to her advertising agency about market research findings for a new product. Her manager will be assessing her presentation. Veronica has spent the whole week working on the presentation, and she wants to make a good impression. She has used the latest software to develop her presentation. She thought the presentation came out well and that it should give the advertising agency the information it needs to make a new commercial. As she enters the conference room, she sets up her laptop and plugs in the USB drive that has the presentation on it. However, she notices that the files on the USB drive have become corrupt. If she hadn't saved the presentation, she would have had to reschedule the meeting for next week. However, Veronica has a backup of the

8 0
3 years ago
The first electric, general-purpose computer, ENIAC, was programmed by calculating algorithms on paper entering code directly in
JulsSmile [24]

Complete Question:

The first electric, general-purpose computer, ENIAC, was programmed by?

Group of answer choices.

A. Calculating algorithms on paper.

B. Entering code directly into the computer.

C. Flipping switches by hand.

D. Using MS-DOS as the operating system.

Answer:

C. Flipping switches by hand.

Explanation:

The first electric, general-purpose computer, ENIAC, was programmed by flipping switches by hand.

ENIAC is an acronym for Electronic Numerical Integrator and Computer, it was developed in 1945 by John Mauchly and J. Presber Eckert. ENIAC was used for solving numerical problems or calculation-related tasks by the process of reprogramming.

In order to give the ENIAC a series of machine instructions to follow in the execution of a task, the programmers had to undergo the cumbersome procedure of connecting, removing, reconnecting cables and flipping switches by hand because data couldn't be stored in memory.

4 0
3 years ago
Samantha was calculating a mathematical formula on an electronic spreadsheet. She used multiple values to recalculate the formul
Bezzdna [24]
<span>Random access memory. This problem requires you to know what the different types of memory are and their relative advantages and disadvantages. Let's look at them and see why 3 are wrong and one is correct. read-only memory: Otherwise known as ROM, this type of memory stores code that can't be over written. Used frequently for constant lookup values and boot code. Since it can't be written to by normal programs, it can't hold temporary values for Samantha. So this is the wrong choice. random-access memory: Otherwise known as RAM, this type of memory is used to store temporary values and program code. It is quite fast to access and most the immediately required variables and program code is stored here. It can both be written to and read from. This is the correct answer. hard disk: This is permanent long term readable and writable memory. It will retain its contents even while powered off. But accessing it is slow. Where the contents of RAM can be accessed in nanoseconds, hard disk takes milliseconds to seconds to access (millions to billions of times slower than RAM). Because it's slow, this is not the correct answer. But it's likely that Samantha will save her spreadsheet to hard disk when she's finished working with it so she can retrieve the spreadsheet later to work on again. compact disk: This is sort of the ROM equivalent to the hard disk. The data stored on a compact disk can not be over written. One way of describing the storage on a compact disk is "Write Once, Read many times". In most cases it's even slower than the hard disk. But can be useful for archiving information or making backups of the data on your computer.</span>
5 0
4 years ago
Read 2 more answers
(q004) why did the changes brought about during the industrial revolution lead to the erosion of kinship networks?
UNO [17]

As industry developed, farming and subsistence lifestyles declined, and migration forced restructuring of family units as men left to work in factories. needed to be more feminine in order to be successful wives.

<h3>What is meant by industry development?</h3>

industrial development means a development that involves a manufacturing or industrial process, and shall contain, but is not limited to, electric power production, food, and food by-product processing, paper presentation, agrichemical production, chemical processes, and storage.

<h3>Why is industrial development important?</h3>

Industrial development releases dynamic and competitive economic performance which generates income and employment, facilitate international trade and increases resource efficiency, and is thus a major driver of deprivation alleviation and shared prosperity.

To learn more about Industrial development , refer

brainly.com/question/1217301

#SPJ4

7 0
2 years ago
Which of the statements below are true about Digital Signatures?
Leokris [45]

Answer:

The answer is "Option a, and c".

Explanation:

Following are the description of the Digital Signature choices:

  • To change the physical transportation of paper or link files in the computerized messaging system, some processes should be identified and utilized in digital signatures, which enables documentation to be validated unforgivably.
  • Using public-key cryptography, digital signatures, that's an exquisite system, that's why options a and b are correct.
  • Digital signatures are not a central authority, that's why the option B is wrong.
5 0
3 years ago
Other questions:
  • Pam wants to include a video from a website in an upcoming presentation. However, she knows she will not have access to an inter
    15·2 answers
  • Read each scenario, and then select the best wireless device for the worker’s needs. A trucker is constantly on the road. He fre
    8·2 answers
  • ¿dispositivos de hardware Que permite identificar la huella digital registrada por el usuario?
    11·1 answer
  • For which purpose is RAM used?
    7·2 answers
  • An IT suspects that an unauthorized device is connected to a wireless network. This is a result of pastry sharing on a device br
    13·1 answer
  • Write a 2-to-3-page research paper describing in plain language the basic purpose, theory, and implementation of GUI application
    6·1 answer
  • (Java)Write a program that calculates and displays the conversion of an entered number of dollars into currency denominations—20
    11·1 answer
  • PLEASE HELP! :)
    14·1 answer
  • What are the 2 levels of formatting in a word document
    15·1 answer
  • Explain with examples what is software​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!