Search for question
Question

R3.12 What is the this reference? Why would you use it?

R3.13 Which of the methods in the CashRegister class of How To 3.1 are accessor methods?

Which are mutator methods?

R4.8 What are the values of the following expressions? In each line, assume that

double x = 2.5;

double y = -1.5;

int m= 18;

int n = 4;

a. x + n *y- (x + n) * y

b.m/n + m % n

c. 5* x

n / 5

d. 1 (1

(1-(1- (1 n))))

e. Math.sqrt(Math.sqrt(n))

R4.12 Find at least five compile-time errors in the following program.

public class HasErrors

{

}

public static void main();

{

}

System.out.print (Please enter two numbers:)

x = in. readDouble;

y = in.readDouble;

System.out.printline("The sum is + x + y);

■ R5.5 What do these code fragments print?

R6.6 What do these loops print?