--------------------------------------------------------------- Assignment Set 1 | Part 2 | Problem Solving in C [Part 1 of Assignment Set 1 is on Linux] Assignment Uploaded : July 30, 2015 Submission Deadline : August 3, 2015 (before lab ends) Clarification Deadline : July 31, 2015 (before lab ends) --------------------------------------------------------------- Problem 1 Write a C program that takes a positive integer 'n' (strictly > 2) as input from the user, and computes the ratio of the (n+1)-th and the n-th Fibonacci numbers, that is, computes the ratio F_{n+1} / F_{n}, where F_1 = 0, F_2 = 1, and F_{n} = F_{n-1} + F_{n-2}. [Note that F_1 = 0, F_2 = 1, F_3 = 1, F_4 = 2, F_5 = 3, F_6 = 5, F_7 = 8, F_8 = 13, etc.] Example Input : n = 5 Example Output : F_6 / F_5 = 1.66666666667 --------------------------------------------------------------- Problem 2 Take two initial points from the user -- (x1, y1), (x2, y2) -- and construct a line joining them together. Take as input a positive integer 'n', and run a loop to take 'n' more points from the user, one at a time. At the input of every new point, determine whether there was a left turn, a right turn or a straight walk in relation to the previous two points. Example Input : (0,0), (2,2) and n = 4 : (3,2), (4,2), (5,1), (6,4) Example Output : Right, Straight, Right, Left --------------------------------------------------------------- Naming conventions for program files. xx is your roll number: For Problem 1: The name of the file for problem 1 of assignment 1 should be ``cs15xx-assign1-prog1.c''. For Problem 2: The name of the file for problem 2 of assignment 1 should be ``cs15xx-assign1-prog2.c''. --------------------------------------------------------------- At the top of each of your program files, add the following. /*------------------------------------------------------------- Name: Roll Number: Date of Submission: Deadline date: Program description: Acknowledgements: --------------------------------------------------------------*/