1. Write a program that decides whether integer

number input1 can be divided by integer number

input2 without remainder. The program should

output “No Remainder” if there is no remainder and

“Remainder is: ” if there is any. In this latter case,

the program should output the value of the

remainder as well.

2. Write a program line that generates the following stream output:

First Name: My_First_Name;;;

Last Name: My_Last_Name;;;

3. What is compilation? What does the compiler do?

(Explain with your own words.)

4. Draw an activity diagram for the following piece of

code:**while**** ( studentCounter <= ****10**** ) {**** ****System.out.print( ****"Enter result (1 = pass, 2 = fail): " ****);**** ****result = input.nextInt();**** **** ****if**** ( result == ****1**** ) **** **** passes++; **** **** ****else**** **** **** failures++; **** **** studentCounter++;**** **** }**

5. Write a FOR loop that sums even integers from 2

through 58

AND

prints out the

FINAL result only.

6. Write a program that prints out primes in a

decreasing order between 1 and 53. (1 is

considered to be a prime here.)

7. Write a piece of code in Java that sets the value of

“int Number” randomly from the following set:

{104, 105, 106, 107, 108}.

8. Write a program segment in java that sets the

value of “int Number” randomly from the following

set: {104, 105, 106, 107, 110}. !

9. Write a method that takes an integer value and

returns the number with its digits reversed. For

example, given the number 8675, the method should

return 5768. Incorporate the method in to an

application that reads a value from the user and

displays the result.

10. Pythagorean Triples. The set of three integer

values for the lengths of the sides of a right triangle

is called a Pythagorean Triple. These three sides

must satisfy the relationship that the sum of the

squares of two of the sides is equal to the square of

the hypotenuse.

Specifically:

a*a + b*b = c*c is true if and only of the triangle is a right triangle.

Write a method that gets 3 input integers and checks

whether those in any order represent a Pythagorean

Triple. The method returns ‘p’ if the numbers are of

Pythagorean Triples and returns ‘0’ otherwise.

Subject | Computer |

Due By (Pacific Time) | 07/06/2015 11:00 am |

Tutor | Rating |
---|---|

pallavi Chat Now! |
out of 1971 reviews More.. |

amosmm Chat Now! |
out of 766 reviews More.. |

PhyzKyd Chat Now! |
out of 1164 reviews More.. |

rajdeep77 Chat Now! |
out of 721 reviews More.. |

sctys Chat Now! |
out of 1600 reviews More.. |

sharadgreen Chat Now! |
out of 770 reviews More.. |

topnotcher Chat Now! |
out of 766 reviews More.. |

XXXIAO Chat Now! |
out of 680 reviews More.. |