1) Look at this
} else if { (time1 > time2
your condition is inside your bracket. You have this a number of times through line 16 and 22 so go in and make sure your conditions are not inside your opening brackets.
2) You are missing semicolons like Zhuge said.
3) Delete your condition on the else statement on line 20. Else statement don't have a condition to them they are just saying if any of the other if statements don't meet their conditions run this.
Other then that you program looks good, some minor suggestions would be to use endl; instead of \n to create a newline since endl; also flushes the buffer and can save you from tracking down them pesky buffer errors.
Another suggestion is to look at how you format your code, make sure it is readable to other people like this part
1 2 3 4 5 6 7
|
if (time1 < time2){
cout << time1 << time2
} else if { (time1 > time2)
cout << time2 << " " << time1
} else {(time1 == time2)
cout << time1 << "==" << time2 << "\n\n"
}
|
can be kind of hard to figure out what statement are in what conditions for some people. I know that everyone has their own style and that is fine but make sure it is readable to someone that has never seen your code before.
Another suggestion which is a minor one is this. When dealing with input from the user never expect them to type it in exactly how you do it. For example
while ("y" == repeat)
If someone typed "Y" they would expect to be able to run the program again, but it wouldn't because "Y" and "y" are not the same. So instead of what you had maybe do something like this
while (repeat == "Y" || repeat == "y")
. The || is basically saying this: While repeat is equal to "Y" OR repeat == "y" run the loop. This way you take care of both inputs.