Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

Describe the implications of situational favorableness.

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago