Implementation of function, JAVA Programming

Assignment Help:

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.

 


Related Discussions:- Implementation of function

Define about the super() constructer, Super() Constructer: It is used t...

Super() Constructer: It is used to call constructor of parent class. Should be the first statement in the body of constructor. Using this we can access private variables

What are the core classes of the struts framework, Struts is a set of coope...

Struts is a set of cooperating classes, servlets, and JSP tags that make up a reusable MVC 2 design. ? JavaBeans components for managing application state and behavior. ? Eve

Java Thread, What is use of join in Java Threading

What is use of join in Java Threading

In programming what is a loop, In programming, what is a loop? A loop i...

In programming, what is a loop? A loop is a programming language statement that permits your code to be repeatedly executed LOOP is a pedagogical programming language designed

How you returning values from methods in java, How you Returning Values Fro...

How you Returning Values From Methods in java ? It's frequent meaningful to have a method return a value to the class which is known as it. This is accomplished through the ret

What is constraints explain with example, What is Constraints explain with ...

What is Constraints explain with example? One of the purposes to use constructors and setter techniques rather than directly accessing fields is to enforce constraints. For exa

Arrays, 1. Arrays and working with arrays

1. Arrays and working with arrays

Why class can''t extend more than one class, Why is an Interface be able to...

Why is an Interface be able to extend more than one Interface but a Class can't extend more than one Class? Basically Java doesn't permit multiple inheritances, so a Class is r

What is a portal?, A portal is a service or a Web site that gives broad ran...

A portal is a service or a Web site that gives broad range of services and resources like e-mail, forums, search engines, weather information, news, on-line shopping, stock quotes.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd