Monday, July 7, 2008

Methods That Send Values Back

Reading
Read the section entitled "Methods That Send Values Back" starting on page 36 to the top of page 39.

Code
Add the method "NumberOfLegs" to your class and call it from your Main method.
Hint: You can copy the method from the book and paste it into your class, but it must be put in the right place.
Be sure to build the project, then run it. Set a breakpoint in your new method and step through the code line by line and understand how it works.

Thursday, July 3, 2008

More About Methods

Reading
Read the section entitled "More About Methods" starting on page 33. Read up to the section entitled "Methods That Send Values Back" on page 36.

Code
Revise your SayHello method to take a string parameter called someName, and use the someName parameter in your method. See an example of this near the bottom of page 34.
In your Main method of the Program class, modifiy the what you call the SayHello method to take the string parameter.

Wednesday, July 2, 2008

Methods

Reading
Read from the bottom of page 28 (Methods) to to top of page 33.

Code

Add a method called SayHello to your Animal class, and call it from your Main method, Your SayHello method should be just like you see on page 30. Remember that to call it, you must say animalvariablexxx.SayHello(); where animalvariablexxx is the name of your declared Animal variable.