Java Reference
In-Depth Information
13. name = console.nextLine();
15. This statement causes the following input dialog box to appear allowing the user to
enter the score.
FIGURE E-1 Chapter 3 Exercise 15
17. JOptionPane.showMessageDialog( null ,
"Current Temperature: 70 degrees",
"Temperature",
JOptionPane.QUESTION_MESSAGE);
19. x = console.nextInt();
ch = console.next().charAt(0);
y = console.nextInt();
21. java.io
23. acctNumber = infile.nextInt();
accountType = infile.next();
balance = infile.nextDouble();
25.
a. Same as before.
b. The file contains the output produced by the program.
c. The file contains the output produced by the program. Old contents are erased.
d. The program would prepare the file and store the output in the file.
Chapter 4
1. a. True; b. False; c. False; d. False; e. False; f. False; g. False; h. False; i. True
3. a. true; b. false; c. true; d. true; e. true
5. 100 200 0
7. Omit the semicolon after else :
if (score >= 60)
System.out.println("You pass.");
else
System.out.println("You fail.");
 
 
Search WWH ::




Custom Search