Test Informed Learning with Examples

Logo

Repository with assignments using the Test Informed Learning with Examples (TILE) method to integrate testing into existing programming courses for free.

Menu

Sets with numbers based on divisibility

Write a program that generates three sets of numbers between 1 and 1000:

the first set consists of all numbers that are divisible by 3, the second consists of all numbers that are divisible by 7, and the third consists of all numbers that are divisible by 11. Then, produce sets of all numbers between 1 and 1000 that are

(a) divisible by both 3, 7, and 11,

(b) that are divisible by 3 and 7, but not by 11, and

(c) that are neither divisible by 3, nor by 7, nor by 11.