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 series of steps followed by an application is known its life cycle. A JSF application typically follows six steps in its life. 1. Restore view phase 2. Apply request valu

Spring configuration file is an XML file. This file having the classes information and defines how these classes are configured and introduced to each other.

Create a class called DeckOfCards that stores 52 objects of the Card class. Include methods to shuffle the deck, deal a deck, and report the number of cards left in the deck. The s

For this Assignment, submit the following program: Create an application for an animal-fur trimming service. The business is open 15 weeks of the year, from April through July. The

I am supposed to call an external application (which is command-line based) and send input to the application from java. I created a batch file to call the application. It successf

Describe what is bytecode? It is an instruction set. It extends with class. 'javac' compiler translates the .java file into .class. JVM interprets bytecode.

What does it mean that a method or class is abstract? An abstract class cannot be instantiated. Abstract methods may only be included in abstract classes. However, an abstract

what is the use of marker interface?

Explain how many ways businesses monitor their employees? • Systems are available which monitor almost every key stroke that an employee forms on a computer. • Systems are avai

Describe synchronization in respect to multithreading. With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared res