Ok, below I have taken parts of the program that I know can be fixed but I don't know how to do it. Is there a way to have the arrival to be one whole vector? or do I have to split it up like i did. It reads HH:MM.
vector<short> arrival_h(20), arrival_m(20), depart_m(20), depart_h(20);
vector<string> list_names;
cin >> hour >> temp >> min;
arrival_h[worker_num - 1] = hour;
arrival_m[worker_num - 1] = min;
cin >> hour >> temp >> min;
depart_h[worker_num - 1] = hour;
depart_m[worker_num - 1] = min;
for ( short l = 0; l < list_names.size (); l++)
{
servd_h = depart_h[l] - arrival_h[l];
servd_m = depart_m[l] - arrival_m[l];
cout << '\n' + list_names[l] + ": ";
cout << arrival_h[l] << ':' << arrival_m[l];
cout << " " << depart_h[l] << ':' << depart_m[l];
cout << " " << servd_h << ':' << servd_m;
}
vector<short> arrival_h(20), arrival_m(20), depart_m(20), depart_h(20);
vector<string> list_names;
cin >> hour >> temp >> min;
arrival_h[worker_num - 1] = hour;
arrival_m[worker_num - 1] = min;
cin >> hour >> temp >> min;
depart_h[worker_num - 1] = hour;
depart_m[worker_num - 1] = min;
for ( short l = 0; l < list_names.size (); l++)
{
servd_h = depart_h[l] - arrival_h[l];
servd_m = depart_m[l] - arrival_m[l];
cout << '\n' + list_names[l] + ": ";
cout << arrival_h[l] << ':' << arrival_m[l];
cout << " " << depart_h[l] << ':' << depart_m[l];
cout << " " << servd_h << ':' << servd_m;
}
Comment