
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
What would be missing line of code

Transcribed Image Text:Write the InputLectures() function in the Collection class. Within InputLectures(), use cin to read pairs of inputs, integer
currDuration and string currTopic, until -1 is read from input. Create a Lecture object with currDuration and currTopic as
arguments and append the object to vector lectureList.
Ex: If the input is 141 Cooking 157 Cars 170 Science 124 Medicine -1, then the output is:
Lecture duration: 141, Topic: Cooking
Lecture duration: 157, Topic: Cars
Lecture duration: 170, Topic: Science
Lecture duration: 124, Topic: Medicine
1 #include <iostream>
2 #include <vector>
3 using namespace std;
4
5 class Lecture {
6
7
8
9
18
public:
void Set Details(int newDuration, string newTopic);
void Print () const;
10
11
12 };
13
14 void Lecture::SetDetails(int newDuration, string newTopic) {
duration = newDuration:
15
CS C
J
private:
int duration;
string topic;
D-

Transcribed Image Text:Write the InputLectures() function in the Collection class. Within InputLectures(), use cin to read pairs of inputs, integer
currDuration and string currTopic, until -1 is read from input. Create a Lecture object with currDuration and currTopic as
arguments and append the object to vector lectureList.
Ex: If the input is 141 Cooking 157 Cars 170 Science 124 Medicine -1, then the output is:
Lecture duration: 141, Topic: Cooking
Lecture duration: 157, Topic: Cars
Lecture duration: 170, Topic: Science
Lecture duration: 124, Topic: Medicine
18
19 void Lecture::Print () const {
20 cout << "Lecture duration: " << duration <<", Topic: " << topic << endl;
21 }
22
23 class Collection {
24
25
26
27
28
29 };
30
31 * Your code goes here /
32
33 void Collection::Print Lectures () {
34
unsigned int i;
35
Lecture currLecture;
36
public:
void Input Lectures();
void Print Lectures();
vector<Lecture> lectureList;
private:
1
CS Scann
Check
Next level
2
Camscanner
3
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 5 steps with 2 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- What line of code would work for this question?arrow_forwardData Definition Language is a programming language, but what is it? Give me an example of what you mean.arrow_forwardAppendix EMPLOYEE Fnamo Minit Lname Ssn Bdato Addross Ser Salary Super ssn Dno 123456789 1965-01-00 731 Fondron, Houston, TX M 30000 333445555 333445555 1955-12-08 638 Voss, Houston, TX John B Smith Franklin Wong 40000 888665555 25000 987654321 999887777 1968-01-10 3321 Castlo, Spring, TX Wallaco 987654321 1941-06-20 201 Borry, Bollaire, TX Alicia Zolaya 4. Jonnifor 43000 888665555 4. Narayan 666884444 1962-09-15 975 Fire Oak, Humblo, TX M 38000 333445555 English 453453453 1972-07-31 5631 Rice, Houston, TX Ramosh K Joyce 25000 333445555 Ahmad V Jabbar 987987987 1969-03-20 980 Dalas, Houston, TX M 25000 087654321 4. James Borg 888665555 1937-11-10 450 Stono, Houston, TX M 55000 NULL DEPARTMENT DEPT LOCATIONS Dnamo Dnumber Mgr ssn Mgr start date Dnumbor Dlocation Rosearch 333445555 1988-05-22 Houston Administration 4. 987654321 1995-01-01 Stafford Headquarters 1. 888665555 1981-06-19 5. Bellaire 5. Sugarland Houston WORKS ON PROJECT Essn Pno Hours Pname Prumber Plocation Dnum 123456789…arrow_forward
- Hi, I am looking for some help to solve this question. I cannot figure out how to solve it and the code below is all I have. The application being used: PostgreSQL edition 12 or 13. I must use LANGUAGE PLPGSLQ as that is what the professor is looking for. Thank you for your help. Tables in the DB:instructor (id, name, dept_name, salary)teaches (id, course_id, sec_id, semester, year) CREATE TEMPORARY TABLE instructor_course_nums (ID VARCHAR(5),name VARCHAR(20),tot_courses INTEGER); CREATE OR REPLACE PROCEDURE Moreno_03_insCourseNumsProc(INOUT i_ID VARCHAR(5))LANGUAGE PLPGSQLAS$$BEGINSELECT name INTO instructor.name FROM instructor WHERE instructor.id = i_id;SELECT COUNT(*) INTO course FROM teaches WHERE teaches.id = i_id;SELECT COUNT(*) INTO l_Exist_count FROM instructor_course_nums WHERE instructor_id= i_id;END;$$;arrow_forwardHi, I am looking for some help to solve this question. I cannot figure out how to solve it and the code below is all I have. Please be advised I am using PostgreSQL. Thus, I must use LANGUAGE PLPGSLQ as that is what the professor is looking for. Thank you for your help. Code CREATE TABLE instructor_course_nums (ID VARCHAR(25), name VARCHAR(25), tot_courses VARCHAR(25)); CREATE TEMPORARY TABLE instructor_course_nums (ID VARCHAR(5),name VARCHAR(20),tot_courses INTEGER); CREATE OR REPLACE PROCEDURE Moreno_03_insCourseNumsProc(INOUT i_ID VARCHAR(5))LANGUAGE PLPGSQLAS$$arrow_forwardImplementation difficulties for Dates and Times data types?arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education