C. De ne merge (Object x) so that if x and Y belong to IntegerSet then x.merge (y)
returns a reference to, an IntegerSet. Z containing the, integers in X and / or y. Set Z
contains no duplicates. For example if x, 5 {1 2 3,,,, 4 5} and Y 5 {3 4 5,,,,, 6 7 8}.
Then Z 5 {1 2 3 4,,,,,,, 5 6 7 8}.
D. A particular lottery allows people to play any set of numbers from 1 through
1 000 000,,.Each number played costs $1. There is one winning number chosen
each week. A group of friends play the lottery and each,, One has some set of
favorite numbers. Possibly some of, the friends have chosen the same numbers.
They decide to pool. Their numbers and split the winnings if any one of their numbers wins
.
.Write a test class that creates three IntegerSet objects containing the lottery
numbers played by three different, friends. Your test class should create a merged
set from the three sets and print out all the numbers in it and how much it will.
cost to play these numbers (i.e, how many numbers).
9. Lattice Points and Complex Numbers
A lattice point on a. Graph is a pair, of coordinates(x y), such that X and y are two
integers. For example, (,), (2 3, 21 22), and (4 0), are lattice points. The point. (0 0),
is called the origin. These points are illustrated as follows:
การแปล กรุณารอสักครู่..