Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

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

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions