1. left0UNIVERSITI TUN HUSSEIN ONN MALAYSIA<br />FACULTY OF MECHANICAL AND MANUFACTURING ENGINEERING <br />BTI 1022: COMPUTER PROGRAMMING<br />LAB EXERCISE 5 Selection and math.h extension<br />Exercise 1:<br />Write a program that converts a period of time specified by user in seconds, to hours, minutes and seconds. Note: there are 60 seconds in a minute and 3600 seconds in an hour.<br />An example of the program output display (user input is in bold):<br /> Enter duration (secs): 12345<br />12345 seconds is 3 hours, 25 minutes and 45 seconds.<br />Exercise 2:<br />Write a program which asks the user to enter an exam mark, and then displays whether or not the mark is valid. Hence it will display the grade for that mark.<br />80-100A<br />60-79B<br />40-59C<br />20-39D<br />0-19E<br />Example of the program output display (user input is in bold):<br />Enter your mark: 150<br />The exam mark must be between 0 and 100 inclusive.<br />Enter your mark: 45<br />Your grade is C.<br />Exercise 3:<br />The following well known sequences of numbers are called the Fibonacci sequence:<br />1,1,2,3,5,8,13,21,34……<br />each number in the sequence is the sum of the previous two numbers. The following Binet formula calculates the value of the nth number in the sequence. Using this formula, write a C program to compute and display the 12th number in the Fibonacci sequence.<br />Use pow() and sqrt() from the standard library <math.h><br />Exercise 4:<br />FMoving Distance<br />θ<br />Write a program which asks the user to enter force, angle and meters of moving distance.<br />Note: W=F*S (W= (F cos θ) x s) sample calculation 25 cos 60 ̊̊ x 8meters. Use cos() from the standard library <math.h><br />Example of the program output display (user input is in bold):<br />