Question: Hello, I am not sure why my code is having errors: ;> /* Write a C++ program outputs the total time an employee spent on
Hello, I am not sure why my code is having errors:
;>
/* Write a C++ program outputs the total time an employee spent on the job each day. The program asks the user to enter the employees name, the arrival time (arrival hour, arrival minute, AM or PM), and departure time (departure hour, departure minute, AM or PM). The program also allows the user to run the program as long as the user wishes. Use Function, timeOnJob, for a full credit. */ #include#include #include using namespace std; void timeOnJob (int arrivalHR, int arrivalMin, int arrivalAM, int departHR, int departMin,int departAM); int main () { //Declare Variable int arrivalHR = 0; int arrivalAM =0; int arrivalMin=0; int departHR=0; int departMin=0; int timeOnJob=0; bool departAM=0; string employeeName=0; char response; char discard; char isAM; //Prompt User cout<<"This program calculates the total time spent by an"<<"employee on the job"< >arrivalHR; cout<<"Enter arrival minute:"< >arrivalMin; cout<<"Enter (y/Y) if arrival is before 12:00 PM:"< >isAM; if (isAM == 'y' || isAM == 'Y') arrivalAM = true; else arrivalAM = false; cout<<"Enter departure hour:"< > departHR; cout<<"Enter departure minute:"< > departMin; cout<<"Enter (y/Y) if departure is before 12:00 PM:"< > isAM; if (isAM =='y' || isAM == 'Y') departAM = true; else departAM = false; cout<
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
