Java | JSP | JSF Answers

Questions answered by Experts: 3 611

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

What value(s) will be output by the following Java code statements?

System.out.println( Math.abs( -5.2 ) ); _________________

System.out.println( Math.pow( 4, 2 ) ); _________________

System.out.println( Math.pow( 2, 5 ) ); _________________
What value(s) will be output by the following Java code statements?

System.out.println( (int)(Math.random()*8) + 1 ); _________________

System.out.println( Math.abs( -5 ) ); _________________

System.out.println( Math.abs( 6 ) ); _________________
What value(s) will be output by the following Java code statements?

System.out.println( (int)(Math.random()*5) + 3 ); _________________

System.out.println( (int)Math.random()*4 + 5 ); _________________

System.out.println( (int)(Math.random()*50) );
What value(s) will be output by the following Java code statements?

System.out.println( Math.random() ); _________________

System.out.println( Math.random() * 3); _________________

System.out.println( (int)(Math.random()*10) + 2);
Discuss the concept of parameters. What are parameters for? What is the difference between formal parameters and actual parameters? Give an example in Java code that illustrates formal parameters and actual parameters.
Write a java programme that will counts all number of words in a sentence.The programme should have a minimum of two classes
Write a java programme that will compute the future investment at a given rate intereste for specified years.The programme should have a minimum of two classes.
Give an example of a while loop, then provide the equivalent do-while loop and for loop. Then

give a diĆ erent example of a do-while loop, along with the equivalent while loop and for loop.

Finally, give an example of a for loop, along with the equivalent while loop and do-while loop. Use

your examples to illustrate the advantages and disadvantages of each looping structure, and

describe those advantages and disadvantage
Question 1. Write True or False for each of the following statements.(corecct if fales)

1-If a method does not return a value, the return value type must be static.

2-The expression !(true || true && false || !true) is evaluated to true.

3-Every array has a length that specifies the number of elements in the array.

4-It is possible for the body of a do-while statement to never be executed.

5-The statement import java.*.*; is valid if placed at the very top of a Java source file.

6-The expression s.indexOf(",") returns the position of a comma in s, a String object.

7-The following statement System.out.print("Hi".compareTo("Hi") == 0); is correct.

8-The switch selection structure must end with the default case.

9-Variables declared in the body of a particular method are known as local variables.

10-int array = new int[10]; creates an integer array of size 10
Question 1. Write True or False for each of the following statements.(corecct if fales)

1-If a method does not return a value, the return value type must be static.

2-The expression !(true || true && false || !true) is evaluated to true.

3-Every array has a length that specifies the number of elements in the array.

4-It is possible for the body of a do-while statement to never be executed.

5-The statement import java.*.*; is valid if placed at the very top of a Java source file.

6-The expression s.indexOf(",") returns the position of a comma in s, a String object.

7-The following statement System.out.print("Hi".compareTo("Hi") == 0); is correct.

8-The switch selection structure must end with the default case.

9-Variables declared in the body of a particular method are known as local variables.

10-int array = new int[10]; creates an integer array of size 10
LATEST TUTORIALS
APPROVED BY CLIENTS