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