abrudtkuhl
ISP
I am a beginner at C++ and am currently working on my first assignment for class. I am running into some errors.
The assignment is to convert seconds of travel to hours/minutes/seconds.
My Code:
//Andrew Brudtkuhl
//ComS 207, section b1
//wed, 9am
#include (iostream.h)
void main (void)
{
int tseconds, tminutes, hours, minutes, seconds;
cout << "Please enter number seconds it took you to get from New York to Los Angeles";
cin >> tseconds
tseconds/60 = tminutes
tminutes/60 = hours
(tminutes%60)60 = minutes
(tminutes%60)%60 = seconds
cout << "The time it takes to get from New Your to Los Angeles is:"; << hours; << " "; << minutes; << " ";
<< seconds;
return 0;
}
My Errors:
hw3.C: In function 'int main (...)':
hw3.C:15: parse error before '/'
If anyone can help it would be greatly appreciated.
The assignment is to convert seconds of travel to hours/minutes/seconds.
My Code:
//Andrew Brudtkuhl
//ComS 207, section b1
//wed, 9am
#include (iostream.h)
void main (void)
{
int tseconds, tminutes, hours, minutes, seconds;
cout << "Please enter number seconds it took you to get from New York to Los Angeles";
cin >> tseconds
tseconds/60 = tminutes
tminutes/60 = hours
(tminutes%60)60 = minutes
(tminutes%60)%60 = seconds
cout << "The time it takes to get from New Your to Los Angeles is:"; << hours; << " "; << minutes; << " ";
<< seconds;
return 0;
}
My Errors:
hw3.C: In function 'int main (...)':
hw3.C:15: parse error before '/'
If anyone can help it would be greatly appreciated.