Ch 4 Questions #3

 

Classes Methods

 

 

 

 

1.         How must private data within a class be accessed.  Give a code example that would do this?

 

2.         If a method does not have a return type what key word must still be included in the method declatation?

 

3.         What parameters would you have for the geometric shapes of squar, rectangle, cube, circle, and sphere?

 

4.         Consider a student object.  List five data variables and three method declarations that could be associated with the student data type

 

5.         Suppose that you are designing a highway simulation.  What objects would you include in your simulation?  What characteristics with respect to data and methods would you include in your object?