CPSC120
Fundamentals of Computer Science

In-class Activity 5

  1. Age in Seconds Yet Again

    Create a Python program that prints the age in seconds of multiple people. The output should be well formatted. The program should use a function to perform the conversion from years to seconds. The function should be properly commented and should use meaningful names for values and simple statements to make the program more readable.

  2. BMI

    Create two functions in Python. One function that returns the body mass index of an individual given the person's height in meters and weight in kilograms. A second function that returns the body mass index of an individual given the person's height in inches and weight in pounds. The body mass index of a person is computed by dividing a person's weight, in kilograms, by the square of the person's height, in meters. The functions should be properly commented and should use meaningful names for values and simple statements to make the code more readable.