Functions Worksheet
-
Write a function called totsecs that has three parms: hours, minutes, and
seconds. The function should compute and return the total number of seconds
given by the hours, minutes, and seconds passed.
-
Write the statements to call your function to convert 2 hours, 15 minutes,
32 seconds into seconds and print the result.
-
Overload the totsecs function by creating a version that has two
parms: hours and minutes. This version should compute and return the
total number of seconds given by the hours and minutes passed.
-
Write the statements to call your function to convert 3 hours, 22 minutes
into seconds and print the result.
-
Create another version of the totsecs function that has three
parms: hours, minutes, and seconds. This version should have default values
of zero for the minutes and for the seconds. Write a prototype for the
function and write the function definition.
-
Write the statement to call the function written in the previous
question to convert 4 hours into seconds. Write the statement to call
the function written in the previous question to convert 4 hours 37
minutes into seconds. Write the statements to call
the function written in the previous question to convert 4 hours, 37
minutes, and 44 seconds into seconds.
Email Me |
Office Hours |
My Home Page |
Department Home |
MCC Home Page
© Copyright Emmi Schatz 2002