Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 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)}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Heres a Java program that implements the requested functions java import javautil public class SetOperations public static void mainString args Scanne... 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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions