Description of this paper

Lab #11 C++

Description

solution


Question

Extra Credit Lab #11 C++;Design a Payroll class that has fields for an employee's name, ID number, hourly pay rate, and number of hours worked. Write the appropriate accessor and mutator methods and a constructor that accepts the employee's name and ID number as arguments. The class should also have a method that returns the employees gross pay, which is calculated as the number of hours worked multiplied by the hourly pay rate.;Your program will also have a main program, which creates one object of that class, initializes the fields of that object and calls the grossPay method (which is defined in the Payroll class).;The main program will ask for the Employee name, ID, pay rate, and hours worked. It will output the gross pay.;Start by creating a class diagram for the Payroll class. See chapter 13 in Starting out with C++ for information on creating classes and objects in C++.;Sample Output;Please enter the employee name Paul;Please enter the ID 77777;Please enter the pay rate 7.25;Please enter the hours worked 40;The gross pay is $290.00

 

Paper#68295 | Written in 18-Jul-2015

Price : $44
SiteLock