Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#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
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