Question: IN C++ microsoft visual studios 2013 Create a simple programmer prototype Library using a .h header file for your GrossPay Function Prototypes. Write a .cpp

IN C++ microsoft visual studios 2013 Create a simple programmer prototype Library using a .h header file for your GrossPay Function Prototypes. Write a .cpp file that includes your functions from your Gross Pay program but no prototypes. Create a program called OverTime that calls getHoursWorked(), and getPayRate() from your GrossPay .cpp file. Make sure that for 40 hours or below, call CalcGross() from your GrossPay program. For more than 40 hours, write a new method (outside of main) in your OverTime program that pays the first 40 hours at straight Pay Rate and anything above 40 hours at 1.5 times Pay Rate. Note - If there were any issues in your old Gross Pay program, make sure they are fixed before using the code for this program.

Here is my gross pay program

#include "stdafx.h" #include using namespace std;

//functions prototype

double getHoursWorked(double hours); double getPayRate(double rate); double calcGross(double gross);

//defining functions int getHoursWorked() { int hours; cout << "Enter the hours worked: ";//prompt user to enter number of hours worked cin >> hours; return hours; } double getPayRate() { double rate; cout << "Enter the pay rate: "; //promt user to enter pay rate cin >> rate; return rate; } double calcGross(int hours, double rate) { return hours * rate; }

int main()

//calling functions getHoursWorked, getPayRate, calcGrossPay

{ int hours = getHoursWorked(); double rate = getPayRate(); double pay = calcGross(hours, rate); cout << "The gross pay is " << pay << endl;//output the gross pay return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!