Section 12.7. Exercises


12.7. Exercises



Exercise 12-1

Create a class Invoice , that has a string property vendor and a double property amount . Overload the addition operator so that if the vendor properties match, the amount properties of the two invoices are added together in a new invoice. If the vendor properties do not match, the new invoice is blank.



Exercise 12-2

Modify the Invoice class so that two invoices are considered equal if the vendor and amount properties match. Test your methods .



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