E3

E4

Write a program that prints out the name, street name, city, phone number all on different lines by taking all the inputs from Scanner one at a time.

E5

The program below is supposed to calculate and show the time it takes for light to travel from the sun to the earth. When you run the program it prints 0 min and -1 sec as the time, which makes no sense. Fix the program so that it will show the correct value of 8 minutes and 20 secs:

E6

Write a console program to define and initialize a variable of type byte to 1 and then successively multiply it by 2 and display its value 8 times. Observe the output and explain the reason for the displayed value in the last output.

Here is the partial code given:

byte a = 1;
a += 2;
System.out.println(a);

Repeat the second and third line 8 times and explain the value that you see in the last output statement.