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
Prototype is having multiple instances or having clone.

Write a program that reads both the girl and boy files into memory using arrays. Then, allow the user to input a name. The program should search through both arrays. If there is

how to implement brute foce in a program?

Depicts the typical communication between external users and the system. The emphasis is on what a machine does rather than how it works it. A use case is a summary of scenarios fo

What is the difference among using bind() and rebind() methods of Naming Class? Ans) Bind method (String name) binds the specified name to a remote object whereas rebind(String

1. Write the pseudocode to get the input of 10 integers from the user and add them up and output the total. (4 points) 2. Compute the output of following pseudocode. Assume that

How can we involve images within a web page using HTML and Java script? Images can be included in HTML through employing tag, below is the format of

Prepare a Java Look and Feel Theme from HTML Template Project Description: For this project you would be needed to create a Java LAF (Look and Feel) Theme from this HTML Y

student are required to construct classes for circle,triangle,trapezium and kite.

Explain the both HashSet and TreeSet? HashSet is an unordered, unsorted Set. It's a Collection set which restrict duplicate elements and also repositioning of elements. I