operations using the C++ programming language

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

Your task for this assignment is to use C++ language to perform basic set operations 1. Perform basic set operations using the C++ programming language. The program should begin by initializing three sets, A, B and C, to the values shown below. Perform the union and intersection of the three sets. Perform these set differences: A-B, B-A, A-C, C-A, B-C and C-B. The total number of set operations performed is eight. A = {P1 P12 P18 P20 P27 P29 P6 P7} B = {P1 P12 P23 P26 P28 P8} C = {P1 P13 P14 P15 P2 P22 P23 P25 P29 P7} 2. The program should output the original set values and the results of the above eight set operations performed, all clearly labeled for the reader. The program output results are to be written to a text file named csc231_prog1_lastname.txt (where lastname is your last name). 3. As a starting point, consider creating and run a Visual Studio C++ project containing the following C++ code. Then make appropriate changes for this assignment: // csc231 program1 sample c++ code // #include #include #include #include #include using namespace std; int main() { string s1 = "c:\\Users\\Kevin Byron\\"; string outFile; cout << "\nPlease enter the output filename: "; cin >> outFile; string inFileAdd2 = s1 + outFile; ofstream out_stream; cout << "File name is " + inFileAdd2 + "\n"; out_stream.open(inFileAdd2.c_str(), ios::out); if (out_stream.fail()) { cout << "Error!! Output file opening failed."; exit(1); } // // your new program code goes here ... // out_stream << "Hello. Done.\n"; } 4. The program should be named csc231_prog1_lastname.cpp, where lastname is your last name. Your C++ program should contain comments starting on line 1 containing this information: a. the ID, section and name of the course b. your name c. this file name d. the program assignment number and due date e. the program purpose You are encouraged to add additional comments throughout the program that your feel might be helpful to the reader of your source code.

Expert Solution
steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Datatypes
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
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