This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
A user wishes to enter a starting time AM/PM format, and delay time in hours and minutes, and have the computer compute and display the time (in AM/PM format) at the end of the delay. This process should repeat until the user enters 999 for the hours portion of the start time. Note: The user will enter the start time as two integers and either 'A' 'a' 'P' 'p' with a space (or spaces in between them, the first representation the hours portion of the time , and second representation the minutes portion of the time and the characters representing either AM or PM. The delay timed will be entered in a similar way.
Example: if the user enters the time 10 13 A and a delay time of 2 05 then the computer should display 12:18pm as the time at the end of the delay.
The program is by no means finished but I have no clue where to go from where I am at in the program. It could all be wrong for what I know. Any help would be appreciated
//Programming project #2
include <iostream>
void computeTimeDifference(int& H, int& M, int& H1, int& M2, int AP ) int main() { int H; int M; int H1; int M2; int AP;
cout << "Enter start time." << endl;
cout << "Enter hours and minutes aswell as either A for AM or P for PM: ";
cin >> H >> M >> AP >> endl;
cout << "Enter delay time." << endl;
cout << "Enter hours and minutes: ";
cin >> H1 >> M2 >> endl;
computeTimeDifference(int& H, int& M, int& H1, int& M2, int AP);
cout << endl << "Delay Time: " << << ":" << endl;
return 0;
} void computeTimeDifference(int& H, int& M, int& H1, int& M2, int AP) {
Subreddit
Post Details
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/cpp_questio...