Thread: Need help
View Single Post
Old 10-18-2005, 11:00 PM   #2 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
Has your class studied functions, yet? At any rate, after you get the starting coords maybe you could store them in float variables called X and Y.

Each time you loop though the input, you should take in a char and use a switch statement. If the char is q, cout << X, Y, or if it is a direction (N,E,S,W) read a float.

The direction itself will tell you what to do with the float. N for example means you should add that float to Y, whereas W, would mean subtract it from X.

Does that outline help enough that you could write the code now?
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote