Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The statements in the following program are not in the correct order. Rearrange

ID: 3622484 • Letter: T

Question

The statements in the following program are not in the correct order. Rearrange the statements so that hte program outputs the total time an employee spent on the job each day. Th program asks the user to enter the employee's name, arrival time and departure time. The program will also allow the user to run the program as long as the user wishes.

Here is the code:

#include<iostream>
#include<string>

using namespace std;

int main()
{
string employeeName;
int arrivalHr;

int departureHr;
int departureMin;
bool departureAM;

char response;
char discard;
char isAM;

cout << "This program calculates the total time spent by an "
<< "employee on the job." <<endl;
cout << "To run the program, enter (y/Y): ";
cin >> response;
cout endl;
cin.get(discard);

while (response =='y' || response == 'Y')
{
cout << "Enter employee's name: ";
getline(cin, employeeName);
cout << endl;

if (isAM == 'y' || isAM == 'Y')
arrivelAM = true;
else
arrivelAM = false;

cout << "Enter departure hour; ";
cin >> departureHr;
cout << endl;
cout << "Enter departure minute; ";
cin >> departureMin;
cout << endl;
cout << "Enter (y/Y) if departure is before 12:00PM: ";
cin >> isAM;
cout << endl;

if (isAM == 'y' || isAM == 'Y')
departureAM = true;
else
departureAM = false;

cout<< employeeName << endl;
timeOnJob(arrivalHr, arrivalMin, arrivalAM, departureHr, departureMin, departureAM);

cout << "Enter arrival hour: ";
cin >> arrivalHr;
cout >> endl;
cout << "Enter arrival minute: ";
cin >> arrivalMin;
cout << endl;
cout << "Enter (y/Y) if arrival is before 12:00PM: ";
cin >> isAM;
cout << endl;

int arrivalMin;
bool arrivalAM;
bout << "Run program again (y/Y): ";
cin >> response;
cout << endl;
cin.get(discard);
}
return 0;
}

 

 

 

 

 

Please help me

 

let me know if you want more points

 

thanks

Explanation / Answer

Hope this helps. Let me know if you have any questions. Well, the program only needed a few things moved around. Here's the code just with the lines moved to correct places. There were also a few typos, like using >> for cout instead of
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote