Question: Write a C++ program that does the following: 1. Accept a list of elements on a single line (separated by spaces). The elements are strings

Write a C++ program that does the following:

1. Accept a list of elements on a single line (separated by spaces). The elements are strings (with no embedded spaces). This is set A.

2. Accept a second list of elements on a single line (separated by spaces). The elements are strings (with no embedded spaces). This is set B. Sets A and B will contain no more than 200 elements each.

3.Display each of the following.

The cardinality and roster of the intersection of A and B

The cardinality and roster of the union of A and B

The cardinality and roster of the relative complement of A and B (i.e. A - B)

The cardinality and roster of the relative complement of B and A (i.e. B - A)

The cardinality and roster of the cross product of A and B

The cardinality of the power set of the cross product of A and B (just the cardinality, not the roster.)

4. You must write your own union, intersection, difference etc. routines. Do not use any C++ libraries to implement these.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!