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
//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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started