Distance Traveled

n/a
Last edited on
The simple answer is the location of the return 0, which is in the while loop and needs to be on the outside.
n/a
Last edited on
One suggestion for general improvement - unless you haven't been specifically asked for a homework assignment to use int variables, you might be better off using double variables, to allow non integer values of user input.
Ah. This is because you are multiplying vehicleSpeed by travelTime, which does not change. I assume you want to multiply it my numCount, which is the variable which increases up to travelTime.

Also, forget my previous post about doubles, I didn't realise you wanted to do this looping thing and it won't work with that.
I think we should start a policy that deleting your posts after you get an answer is a bannable offense.

Not like it would matter though, since these people will probably never show their face here again anyway. Probably just some homework problem.
Or how about just preventing new users from removing characters from their posts?

-Albatross
Many forums do not allow editing of posts at all.
Strange - Why would someone erase their post after an answer?
I don't think that a policy banning editing is a good idea - I've often had to quickly edit my posts to make them easier to understand or answer!
closed account (D80DSL3A)
Why would someone erase their post after an answer?
Removing evidence perhaps?
OP may fear that his teacher would find the thread.
Yeah that's probably what he was thinking, but it's crap.

There's no solutions posted here so I don't see what the problem could possibly be. Any teacher that discourages independent research should not be teaching.
I think disallowing editing for the first n posts would be a nice solution. Editing is convenient but it's never a necessity. You can always write another post.
closed account (zb0S216C)
OP may fear that his teacher would find the thread

Even if his/her teacher found the thread, they would never know who is behind the account.
If he posted his code, the teacher would be able to figure it out.

But I agree it's a longshot and a teacher wouldn't care anyway.
Topic archived. No new replies allowed.