Question: Use C language only (AND NOT C# or C++ or java or any other language.) Requirement: let user input a coordinate in following format (x,

 Use C language only (AND NOT C# or C++ or java

Use C language only (AND NOT C# or C++ or java or any other language.) Requirement: let user input a coordinate in following format (x, y) as a start point, Then continuously let user enter a set of command and update the coordinate accordinging. The command must use the following (l - for left, r - for right, d - down, u - up, s - stop). For example, if initial position is given x = 5, y =6. (5, 6) And if command key (l) is entered. Then an application will output new line call "Current location is (4, 6)" without interrupting. Then, the application will continue to prompt user for another command without interrupting "please press next command". Then, If a letter other than the 5 allowed letter (l, r, d, u, s) here is entered. The application will output message "command exception, last location is (4, 6)" and without interrupting Then, If command key (d) is pressed. The application will update the position from (4, 6) to (4, 5) and output the following message "current location is (4, 5)." without interrupting Then, If the command (r) is pressed. The application will continue to update from last location (4, 5) and output new message "current location is (5, 5)". without interrupting Then, If command key (u) The application will update the position from (5, 5) and output new message "current location is (5, 6)". without interrupting Finally, If the command (s) is pressed, the application will repeat the last position (5, 6) and output message "location is (5, 6)" application will stop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!