Section 8.6. Exercises


8.6. Exercises



Exercise 8-1 .

Write a program with an overloaded method for doubling the value of the argument. One version of the method should double an int value, and the other version should double a float value. Call both methods to demonstrate that they work.



Exercise 8-2 .

Write a program with one method that takes an int value, and returns both double and triple that value. You'll need to use reference parameters.



Exercise 8-3 .

Modify the program from Exercise 8-2 so that you don't need to initialize the variables that will hold the doubled and tripled values before calling the method.



Learning C# 2005
Learning C# 2005: Get Started with C# 2.0 and .NET Programming (2nd Edition)
ISBN: 0596102097
EAN: 2147483647
Year: 2004
Pages: 250

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net