• Forum
  • Lounge
  • Can Someone PLASE show me what I am doin

 
Can Someone PLASE show me what I am doing wrong with this program

This is the instruction:

Utilize a function to covert hours-minutes-seconds to seconds.
Prompt the user to enter input in the format described on my example
(format 12:59:59).
Display on the screen the results of the conversion.

please can someone show me this example program I need to do thanks
_______________________________________________________________________________
This is how the program should play out;

Enter time (format 12:59:59)
(0:0:0 to quit): 12:45:45 <---what you type
Seconds = 45945 <---Result

Enter time (format 12:59:59) (with this format)
(0:0:0 to quit): 0:0:0 <--- what I have to do in order to exit the program

_______________________________________________________________________________

this is my code:
_______________________________________________________________________




#include <iostream>

using namespace std;

int main()
{
int hour,minute,second,timeinsec;





cout << "Enter time (format 12:59:59)" << endl;
cout << "(0:0:0 to quit):"<< hour<< minute<< second<<endl;
cout <<endl;


timeinsec = (hour * 3600) *(minute * 60) + second;

cout <<" seconds:" <<timeinsec <<endl<<endl;



cout << "Enter time (format 12:59:59)" << endl;
cout << "(0:0:0 to quit):"<< endl;
cin>>



return 0;
}






The problem is this line :
1
2
3
cout << "Enter time (format 12:59:59)" << endl;
cout << "(0:0:0 to quit):"<< hour<< minute<< second<<endl;
cout <<endl;


You did not put any cin statements here.
A piece of advice: You're much more likely to get people to read your post, and give you help, if you post in the correct forum. The Lounge is for:

Discussions about this website, or other topics not related to C++ programming


To see the list of forums, with descriptions of what they're for, see:

http://www.cplusplus.com/forum/
Topic archived. No new replies allowed.