Question: I need help with these programming questions in C language. Question 1. Functions in C. A safe is typically used to secure valuable objects against

I need help with these programming questions in C language.  I need help with these programming questions in C language. Question
1. Functions in C. A safe is typically used to secure valuable
objects against theft ar damage. Opeming a safe requires a dial to
be spun in clockwise and anti-clockwise revolutions according to a fix combination
of numbers. The diagram below shows a dial with one hundred graduations

Question 1. Functions in C. A safe is typically used to secure valuable objects against theft ar damage. Opeming a safe requires a dial to be spun in clockwise and anti-clockwise revolutions according to a fix combination of numbers. The diagram below shows a dial with one hundred graduations ranging from 0 to 99, and is currently set at position 25 Assume that the number of graduations of the dial is fixed at 100. (a) Suppase the dial is spun anti-clockwise starting from position 25 for 30 graduations. The resulting position of the dial is 55. Spinning the dial anti-clockwise starting from position 25 for 80 graduations will result in the dial ending at position 5 Implement the function antispi n that takes in the starting pasition start and a positive number of graduations num and returns the final position after the spin. Note that the value of num may be greater than 100, hence requiring more than one complete turn of the dial. int antispin (int start, int num) (b) Suppase the dial is now spun clockwise starting from position 25 for 20 graduations. The resulting position of the dial is 5. Spinning the dial clockwise starting from pasitian 25 for 40 graduations will result in the dial ending at positian 85 Implement the function spin that takes in the starting position start and a positive number of graduations num and returns the final position after the spin Note that the value of num may be greater than 100, hence requiring more than one complete turn of the dial. int spin (int start, int num) (c) Write a C program safe.e, the program reads in three pasitive numbers, say x, y and z, and performs an anti-clockwise spin for x graduations, followed by a cockwise spin for y graduations, and finally another anti-clockwise spin z graduations. Assume that the dial is set to position 0 at the start. A sample run of the program is given below. User imput is underlined. Enter three numbers: 123 234 345 The dial is at position 34

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!