classes :: classwork

Answer the following questions:

  1. How can a constructor be identified?
  2. Could a private variable be used outside of the class where it has been declared?
  3. What is the purpose of a constructor?
  4. What keyword calls on the constructor to create an object?
  5. What operator is used to associate objects and members?
  6. Create an object of type Shape named "squared".
  7. What is the purpose of the get() accessor method?

Payroll mini assignment

  • Partially re-write CPT 1
  • Create an object of type GrossPay that will return the weekly pay of an employe
  • Create an object of type Taxes that will return the taxes of an employe
  • Use DemoEmployee (main()) to instantiate a GrossPay and Taxes objects
  • Calculate the NET pay only
  • Use as many arguments as you see fit
  • Must use an Accessor Method
  • If you want ot write a third class to compute the net pay, go ahead
For answer to Payroll mini assignment click here