Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What are the central issues concerning ethics in HRM?

Answered: 1 week ago