Starting from:
$30

$24

Homework 01: Annual Growth Program Solution




Implement a program that:

1. Asks the user to enter her/his:

* first name

* last name

* birth year

* height (in feet and inches; e.g., 5'10") *Note: You will need to ask for both separately*

 

2. and subsequently,

* approximates the user’s age as their birth year subtracted from the current year (2016).

* calculates his/her height in centimeters. *Note: 1 inch is 2.54 centimeters; moreover, there are 12 inches in one foot.*

* computes her/his average annual growth per year in centimeters, under the assumption that one’s height at birth is 51 cm

 




Your implementation should be written such that it is easily readable by other programmers. Use comments where appropriate and use appropriate variable identifiers.




The output of your program should resemble the following:




``Hello <first name <last name. You were <age years old in 2016, and

your height is <height cm. That means that you grew an average of

<value cm per year (assuming you were 51 cm at birth).``

More products