Implementation of function, JAVA Programming

Suppose that:

A is the set of characters in the string "pellet";

B is the set of characters in the string "teller";

C is the set of characters in the string "pertinent";
and D is the set of integers enumerated below.

D = {11, 22, 33, 44}

(a) Write down an enumeration of each of the following three sets.

A ∪ B

A ∩ B

C - A

Give the cardinality of A ∪ B.

(b) Write down the value of each of the following propositions. Give a brief expla- nation of your answer in each case.

(i) (44, 't' ) ∈ D x A

(ii) B ⊆ A

(i ii ) C -(A ∪

B) = = (C -A )

∩ (C - B) [4 marks)

(c) Enumerate the set E, defined below by comprehension.

E = {n in Int: (4 < n) ∧

(n < 19) ∧

(MOD(n,3) = = 1)} [3 marks]

(d) A function MULTFIVE is specified below.

function MULTFIVE(n in Int) return in Set of Int pre true.
post The returned value is the f o l l o wing set:
{ i in Int : i ≤ n and there is an integer j > 1 such that i == 5 x j }.


For example, MULTFIVE(23) is the set {10,15,20}.
Give code to implement MULTFIVE.


Enter your implementation of MULTFIVE in the Function Window in the WorkPad, and use the WorkPad to test it when the i n p u t , n is 44. Save the WorkPad file which you use in your testing. Include the contents of this file as part, of your Solution Document.

 

Posted Date: 3/7/2013 1:59:20 AM | Location : United States







Related Discussions:- Implementation of function, Assignment Help, Ask Question on Implementation of function, Get Answer, Expert's Help, Implementation of function Discussions

Write discussion on Implementation of function
Your posts are moderated
Related Questions
a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b

#queThis assignment will give you practice with defining classes. You are to write a set of classes that define the behavior of certain animals. You will be given a program that r

Describe Member Variables vs. Local Variables ? class Car { String licensePlate = ""; // member variable double speed; = 0.0; // member variable double maxSp

What is difference between time slicing and preemptive scheduling? Differences between preemptive and time scheduling are: In case of Preemptive scheduling the highest prior

Prototype is having multiple instances or having clone.

What is an intelligent system? Intelligent systems are the programs established to perform complicated jobs in which reflect human brain and thoughts. If the algorithms are too m

what is join in java Thread

Explain The Methods of java.lang.Object? java.lang.Object gives a number of methods that are general to all objects. toString() is the most general such method. Because the def

What is best algorithm? Greedy algorithm is the best algorithm as it is n algorithm in which always takes the best immediate, or local solution although searching an answer.

Need support Display TIFF in Internet Explorer without ActiveX plugin I would like to get a client side viewer designed that permits user to view TIFF files on IE 8 and IE 9 bro