Project #22816 - 7 questions

Question 1

Write a program that reads an integer and prints out “Is Divisible By 7” or “Isn't Divisible by 7”, 

depending on whether the integer is divisible by 7 or not.

Your program must use an if-then-else statement.

Quastion 2

Write a program that works the same as in Question 1, but uses a switch statement instead of an if-then-else statments  

Question 3

Consider the following code for computing the letter grade from a numeric score (assume score is a double and has been initialized, and grade is a String).

if (score >= 60.0)

grade = "D";

else if (score >= 70.0)

grade = "C";

else if (score >= 80.0)

grade = "B";

else if (score >= 90.0)

grade = "A";

else

grade = "F";

 

Explain what is wrong with this code?

Question 4

Write a program that uses a switch statement to compute the name of a day from a number between 1 and 7 representing the day.

Question 5

Write a program that reads an integer N, computes the product of the integers 1..N, and then prints out the result.

Question 6

Consider the following code:

int count = 0;

while(count < 100)

{

// Point A

System.out.println("Java");

count++;

// Point B

}

// Point C

Is count < 100 always true, always false, or sometimes true or sometimes false at Points A, B and C in 

the code?

Question 7

Write a program reads in numbers (doubles) until a zero is input and computes the maximum and 

minimum of all the read numbers (excluding the terminating zero).  

i want the easiest way, this is intro to java class

 

Subject Computer
Due By (Pacific Time) 02/14/2014 12:00 am
Report DMCA
TutorRating
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..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy