Question: Problem 2 (40 pts) : Universal set U={1,2,,100} is given. The following sets are subsets of the universal set U: A={x | x is even,

Problem 2 (40 pts): Universal set U={1,2,,100} is given. The following sets are subsets of the universal set U:

A={x | x is even, i.e. x is evenly divisible by 2}

B={y | y is evenly divisible by 3}

C={z | z is evenly divisible by 5}

Determine |A B C|.

Give a for loop in Java to display all the numbers in A B C in such a way that only 10 elements will be displayed in each row except the last one.

for(n=1;n<=100;n++){

if( ((n%3!=0) || (n%5!=0)) {

.

}

}

Describe set D={n | body of if statement above is executed} in terms of sets given above and set operations.

for(n=1;n<=100;n++){

if( ((n%2!=0) && (n%5==0)){

.

}

}

Like (c), describe a set E for body of if statement.

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!