Doyle: C#, 5th edition Page 1-1
1. b. void
2. d methods
7. a. back to the location in the calling method that made the call
8. c. DetermineHighestScore(val1, val2)
9. e. SetNoOfSquareYards(double)
10. b. local variables
C# Programming: From Problem Analysis to Program Design, 5th edition
Chapter 3
Doyle: C#, 5th edition Page 1-2
call: InputValues(out val1, out val2);
17. a. int
21. a. 2, 2, 0
22. a.
static void DisplayAsterisks( )
Doyle: C#, 5th edition Page 1-3
}
c.
static void DisplayNumbers(double v1, double v2)
{
WriteLine(“Value 1 : {0:N3}”, v1);
WriteLine(“Value 2 : {0:N3}”, v2);
}
23. a. DisplayAsterisks( );
b. DisplayName(“Jason Cheng”);
Doyle: C#, 5th edition Page 1-4
24. a. 64
25.
Syntax:
1. End the comment with a */
Doyle: C#, 5th edition Page 1-5
3. Syntax error generated in the first call to the WriteLine( ) method because
argument (val1) does not match variable (VAL1).
7. aValue could be declared as a string argument in GetAge( ) method. No
need to send it as an argument. Could send age as an argument. If you did,
it would need to have the out parameter type added to both the method
heading and the call.
Doyle: C#, 5th edition Page 1-6
-GETVal1( ) method name also does not follow standard naming convention.
Name of the method should be GetVal1( ). Should change the heading and the call
Below is the working solution with the above modifications.
/* *********************************************
*/
}
Doyle: C#, 5th edition Page 1-7