Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

More Books

Students also viewed these Databases questions