Graded Lab Practice March 19 Challenge: USE FUNCTIONS

  1. Problem 1 (70 points):

    Write a program that asks the user to enter the length of the legs of a right triangle. The program calculates and prints the area of the triangle using the following formula: area = (leg1*leg2)/2

  2. Problem 2 (15 points)

    Write a program that reads ONE 4-digit positive INTEGER number and finds the average of the last and first digits, and the average of the middle digits.

  3. Problem 3 (10 points)(YOU ARE NOT ALLOWED TO USE IF ELSE statement in this program).

    Flights are often delayed. Your task is to write a program that reads an original departure time (two integers representing hour and minutes) and the delay in minutes and outputs the updated departure time as two integers representing an updated hour and updated minutes. Assume that time is in 24 - hour format.

    Example:
    Input: 14 55 127 (Explanation: original departure time was 14:55 and there is 127 minutes delay)
    Output: 17 02


    Input: 23 35 57
    Output: 00 32