C# Programming: From Problem Analysis to Program Design, 5th edition
Chapter 1
1. e. Assembly
2. d. compiler
3. b. Design the solution before coding
4. a. analysis
5. d. iterative development
6. d. desk-check the solution
7. a. attributes or characteristics
8. e. System
9. d. Web
10. a. /*
11. d. namespace
12. d. namespace
13. b. {}
14. c. using
15. b. System.Console.Read( )
16. a. prototype
,17. d. IntelliSense
18. c. execute
19. c. \n
20. d. Console.Write(“ok”);
21. Syntax—Semicolon left off of Line 2 or Line 9. Other potential
problems include typing main( ) instead of Main( ) or
failing to have a closing curly brace.
Logic—Displaying the wrong message or asking for input
instead of displaying output.
22. Go Forth and DO
Awesome Stuff!
23. Replace the WriteLine( ) method on Line 11 with a Write( )
method
24. a. Lines 9 through 13
b. defined on Line 3
c. Line 5
d. Lines 9 through 13
e. Lines 3 and 5 contain user-defined identifiers
, 25. Semicolon needed at the end of Line 1 and Line 8; keyword
namespace misspelled on Line 2; keyword class
missing from Line 4; keyword void missing from
Line 6; and Console and Write should begin with uppercase
C# Programming: From Problem Analysis to Program Design, 5th edition
Chapter 2
characters.
1. d. sampleValue
2. c. floating-point
3. c. string
4. e. all of the above
5. c. using
6. d. double does not require suffixing a numeric literal with a
value such as ‘m’ or ‘f’.
7. b. string nameOfBook;
8. a. classes
9. b. 417
10. c. bool upperLimit;
11. a. places a value in memory that cannot be changed
, 12. d. result += 15;
13. c. 8
14. c. 28
15. d. all of the above
16. a. ans = value1 + value2 * value3 – (value4 + % 2) *
7;
8 6 4 7 3 1 2 5
b. ans += value1-- * 10;
3 2 1
c. ans = (((value1 + 7) – 6 * value2) / 2);
5 1 3 2 4
d. ans = value1 + value2 / value3 * value4--;
5 4 1 2 3
17. a. valid
b. invalid; # is an invalid character
c. invalid; has embedded spaces
d. valid
e. valid
18. a. int noOfCorrectResponses;
Chapter 1
1. e. Assembly
2. d. compiler
3. b. Design the solution before coding
4. a. analysis
5. d. iterative development
6. d. desk-check the solution
7. a. attributes or characteristics
8. e. System
9. d. Web
10. a. /*
11. d. namespace
12. d. namespace
13. b. {}
14. c. using
15. b. System.Console.Read( )
16. a. prototype
,17. d. IntelliSense
18. c. execute
19. c. \n
20. d. Console.Write(“ok”);
21. Syntax—Semicolon left off of Line 2 or Line 9. Other potential
problems include typing main( ) instead of Main( ) or
failing to have a closing curly brace.
Logic—Displaying the wrong message or asking for input
instead of displaying output.
22. Go Forth and DO
Awesome Stuff!
23. Replace the WriteLine( ) method on Line 11 with a Write( )
method
24. a. Lines 9 through 13
b. defined on Line 3
c. Line 5
d. Lines 9 through 13
e. Lines 3 and 5 contain user-defined identifiers
, 25. Semicolon needed at the end of Line 1 and Line 8; keyword
namespace misspelled on Line 2; keyword class
missing from Line 4; keyword void missing from
Line 6; and Console and Write should begin with uppercase
C# Programming: From Problem Analysis to Program Design, 5th edition
Chapter 2
characters.
1. d. sampleValue
2. c. floating-point
3. c. string
4. e. all of the above
5. c. using
6. d. double does not require suffixing a numeric literal with a
value such as ‘m’ or ‘f’.
7. b. string nameOfBook;
8. a. classes
9. b. 417
10. c. bool upperLimit;
11. a. places a value in memory that cannot be changed
, 12. d. result += 15;
13. c. 8
14. c. 28
15. d. all of the above
16. a. ans = value1 + value2 * value3 – (value4 + % 2) *
7;
8 6 4 7 3 1 2 5
b. ans += value1-- * 10;
3 2 1
c. ans = (((value1 + 7) – 6 * value2) / 2);
5 1 3 2 4
d. ans = value1 + value2 / value3 * value4--;
5 4 1 2 3
17. a. valid
b. invalid; # is an invalid character
c. invalid; has embedded spaces
d. valid
e. valid
18. a. int noOfCorrectResponses;