Doyle: C#, 5th edition Page 1-1
1. c. public
2. e. classes
6. a. ToString( )
7. d. data behavior
8. c. int CalculateAvg( )
13. e. Name
14. a. Employee employee1 = new Employee( );
C# Programming: From Problem Analysis to Program Design, 5th edition
Chapter 4
Doyle: C#, 5th edition Page 1-2
17. c. public
20. b. override
21. a. Lines 12, 15/16 and 22 are heading.
22. When you write your own classes you create instance methods. Instance
methods do not use the static keyword in their heading. To call an instance
Doyle: C#, 5th edition Page 1-3
23. To override a method you are providing a new definition for a method. The
ToString( ) method is often overridden to show what should be displayed if an
24. The constructor is used to create an instance of the class. It is a method used to
25. The data members and methods should be indented or tabbed inside the curly
braces. Constructors should have public access. Constructor taking three
Below is the working solution with the above-mentioned modifications.
Doyle: C#, 5th edition Page 1-4
public Chair()
{
}
public string Type
{ get
{ return type;
}
}