Enter two lists of numbers within the range [0, 9] from keyboard, either use flag to denote
Question:
Enter two lists of numbers within the range [0, 9] from keyboard, either use flag to denote end of the list or ask user to enter the list size first and then enter the list numbers. Each of these two lists represents a set ( duplicate elements are not allowed in a set) we have two sets A and B. Suppose the universal set is U = {0,1,2,,9}. implement the following functions:
Print out AB.
Print out AB.
Print out B 0 .
Print out (AB)A.
Output:
Please enter unique element and enter -99 to end the entering:
1
2
2
Element already exists, please reenter.
3
-99
Set A: {1, 2, 3}
Please enter unique element and enter -99 to end the entering:
2
3
4
-99
Set B: {2, 3, 4}
Union of set A and B: {1,2, 3, 4}
Intersection of Set A and B: {2,3}
Set B's Complement: {0,1, 5, 6,7,8,9}
Production of (intersection of Set A and B) and A: {(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)}
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill