Question: #include #include #include using namespace std; int main ( ) { / / declare and populate the arrays to hold the first two columns of
#include
#include
#include
using namespace std;
int main
declare and populate the arrays to hold the first two columns of table
Name and ID column
string name
"Bill Smith",
"Sally Mae",
"Tom Williams",
"John Cook",
"Bill Joy",
"Sue Bach",
"Pam Little"
;
int id
;
const int SIZE ;
int hoursSIZE;
double payRateSIZE;
Data input for hours and payRate arrays
for int i ; i SIZE; i
cout namei idi hoursi;
input validation, check for negative numbers
while hoursi
cout "Error: hoursiis negative." endl;
cout "Please enter a positive value." endl;
cout "Enter hours worked eg: ;
cin hoursi;
cout "Enter pay per hour eg: ;
cin payRatei;
input validation, check for values less than NC min wage
const double NCMINWAGE ;
while payRatei NCMINWAGE
cout "Error: payRateiis less than NCMINWAGE." endl;
cout NCMINWAGE is NCMINWAGE endl;
cout "Please enter a value greater than the min wage." endl;
cout "Enter pay per hour eg: ;
cin payRatei;
Display pay
cout fixed showpoint setprecision;
cout "Gross Pay" endl endl;
for int i; i SIZE; i
double pay hoursi payRatei;
overtime needed for hours
ifhoursi
pay hoursi payRateihoursipayRatei;
Display payRate
cout namei idi: $ pay endl;
return ;
I am needing the program to calculate time and a half.
Bill Smith hr $ per hr
Sally Mae hr $ per hr
Tom Williams hr $ per hr
John Cook hr $ per hr
Bill Joy hr $ per hr
Sue Bach hr $ per hr
Pam Little hr $ per hr
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
