CSC 2302, Data Structures- Fall 2021
Assignment 1(Due October 02)
Exercise 1:
Write a program embedding a function called elapsedTime with two parameters,
the start time and the end time. Each parameter is a structure of type time with
three fields: the hours, minutes and seconds of a specific time.
The function is to return a time structure containing the time elapsed between the
two parameters.
You must handle the situation when the start time is in the previous day.
Examples:
Input: 15h 23mn 45s Input: 15h 23mn 45s
10h 10mn 30s 10h 50mn 30s
Output: 5h 13mn 15s Output: 4h 33mn 15s
Input: 15h 23mn 45s Input: 1h 23mn 45s
10h 10mn 50s 10h 10mn 30s
Output: 5h 14mn 55s Output: 15h 13mn 15s
Exercise 2:
Using the recursive approach, write a complete program that prompts the user to
enter an integer and prints the number of its digits.
Example: If the input n = 3159, then the output should be 4
Exercise 3:
Let and be asymptotically positive functions. Prove the following
conjecture: