iven a problem(see attachment) And the program, Fill up the blank spaces in the program in order to make the program work correctly. ------------------------------------------------------------ PLACE TO FILLUP THE BLANK SPACES IN THE PROGRAM BELOW AT LINES NUMBER:- ( 11 , 19 , 25 , 29 , 35 , 39 )

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Given a problem(see attachment) And the program, Fill up the blank spaces in the program in order to make the program work correctly.

------------------------------------------------------------

PLACE TO FILLUP THE BLANK SPACES IN THE PROGRAM BELOW AT LINES NUMBER:- ( 11 , 19 , 25 , 29 , 35 , 39 ) 
 

1 #include <iostream> 
2 #include <set> 
3 #include <list> 
4 using namespace std; 
5 int main() { 
6     int s1,v1,s2,v2; 
7     cout<<"Enter the number of values in list 1"<<endl; 
8     cin>>s1; 
9     cout<<"Enter the values"<<endl; 
10     set<int> set1; 


11     for( _______ )


12         cin>>v1; 
13         set1.insert(v1); 
14     } 
15     cout<<"Enter the number of values in list 2"<<endl; 
16     cin>>s2; 
17     cout<<"Enter the values"<<endl; 
18     set<int> set2; 


19     for(_____________)


20         cin>>v2; 
21         set2.insert(v2); 
22     } 
23     cout<<"Set 1"<<endl; 
24     set<int>::iterator it; 


25     for(_________) 


26         cout << *it <<endl; 
27     cout<<"Set 2"<<endl; 
28     set<int>::iterator it1; 


29     for(___________) 


30         cout << *it1 <<endl; 
31     cout<<"Union"<<endl; 
32     set1.insert(set2.begin(), set2.end()); 
33     list<int> list1; 
34     set<int>::iterator sit; 


35     for(_________) 


36     list1.push_front(*sit); 
37     list1.sort(); 
38     list <int> :: iterator itr; 


39     for(___________) 


40         cout << *itr <<endl; 
41 } 

A program to get 2 lists of numbers as input and store them in 2 sets 1 and 2 and then
find the union of 2 sets.
[All text in bold corresponds to input and the rest corresponds to output.]
Sample Input and Output:
Enter the number of values in list 1
4
Enter the values
5
5
6
8
Enter the number of values in list 2
3
Enter the values
9
10
Set 1
5
6
8
Set 2
10
Union
10
5689음
Transcribed Image Text:A program to get 2 lists of numbers as input and store them in 2 sets 1 and 2 and then find the union of 2 sets. [All text in bold corresponds to input and the rest corresponds to output.] Sample Input and Output: Enter the number of values in list 1 4 Enter the values 5 5 6 8 Enter the number of values in list 2 3 Enter the values 9 10 Set 1 5 6 8 Set 2 10 Union 10 5689음
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education