Question: 4 . Write a C program that reads the first letter of direction (North, South, East, West), current (x,y) coordinate, and advancement of a person

4. Write a C program that reads the first letter of direction (North, South, East, West), current (x,y) coordinate, and advancement of a person and prints the new coordinate. For e.g., if the current coordinate of a person in X- Y plane is (2,3) and s/he advances 6 units towards North, then his/her new coordinate is (2,3+6)=(2,9). Sample input/output (bold ones are user inputs):

Enter current coordinate (x and y positions): 2 3

Enter No. units towards direction: 6

Enter Direction: N

New coordinate: (2,9)

5. Solve question#4 using switch-case.

4. Write a C program that reads the first letter of direction

please write the c programs for this questions

4. Write a C program that reads the first letter of direction (North, South, East, West), current (x,y) coordinate, and advancement of a person and prints the new coordinate. For e.g., if the current coordinate of a person in X- Y plane is (2,3) and s/ he advances 6 units towards North, then his/her new coordinate is (2,3+6)=(2,9). Sample input/output (bold ones are user inputs): Enter current coordinate (x and y positions): 23 Enter No. units towards direction: 6 Enter Direction: N New coordinate: (2,9) 5. Solve question\#4 using switch-case

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!