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
The "http protocol" is a stateless response or request based protocol. You may contain the state information between different page requests as given below: HTTP Sessions are

String is immutable in java : you can't change a string object but can replace it by creating a new object instance. Creating a new instance is rather expensive.   //Non ef

Ask1. Storing the Array: Write an application that uses an Array to store 10messages of type String. You will store this Array with 10 messages of your choosing. For example, a mes

1. Which of the following are not valid Java identifiers, and why? (a) wolVes (b) United(there is only one) (c) 87 (d) 5 3 (e) Real ale (f) isFound?by 2. A class Television

Information Retrieval during Multi-Agent System with Data Mining in Cloud Computing Project Description: I have proposed one research model on "Information Retrieval during M

Explain the term- Strings A string is generally considered to be a sequence of characters stored in memory and accessible as a unit. Strings in java are signified as objects

palindrome is starting that reads both the ends.using string covert into character

I want FitLIFE app for Android, IOS, Windows Project Description: Hello, I want to develop an app for Android, IOS and Windows Phone. This app will be work with open source B

Problem Definition A new Met Office web application will allow users of their web site to view rainfall statistics for months and years in the UK. The application allows the m

Messaging is a method of communication among software components or applications. A messaging system is a peer-to-peer facility: A messaging client can send messages to, and receiv