Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/etc/Job/CommissionWorker.inl

Go to the documentation of this file.
00001 // Implementation of class CommissionWorker
00002 #ifndef __J2K__CommissionWorker_INL__
00003 #define __J2K__CommissionWorker_INL__
00004 
00005 #include <j2k/Fred/Job/CommissionWorker.hpp>
00006 
00007 inline CommissionWorker::CommissionWorker(
00008    const char* first, const char* last,
00009    double sal, double comm, UINT qty
00010    )
00011    : Employee( first, last ), salary( sal )
00012      commission( comm ), quantity( qty ) {  }
00013 
00014 // Set CommissionWorker's weekly base salary
00015 inline void CommissionWorker::setSalary( double sal ) {
00016   salary = sal;
00017 }
00018 
00019 // Set CommissionWorker's commission
00020 inline void CommissionWorker::setCommission( double comm ) {
00021   commission = comm;
00022 }
00023 
00024 // Set CommissionWorker's quantity sold
00025 inline void CommissionWorker::setQuantity( UINT qty ) {
00026   quantity = qty;
00027 }
00028 
00029 // Determine CommissionWorker's earnings
00030 inline double CommissionWorker::earnings() const {
00031   return ( salary + commission * quantity );
00032 }
00033 
00034 // Print the CommissionWorker's name 
00035 inline void CommissionWorker::printName() const
00036 {
00037    cout << "\nCommission worker: ";
00038    Employee::print();
00039 }
00040 
00041 #endif

Generated on Sun Oct 14 18:46:31 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001