Write a program TotalHeight.java
that uses an int
variable to establish a person’s height in feet (just the feet part) and a double
variable to store the inches part. (A person who is 5 feet, 2 inches would have a feet = 5
and inches = 2
, for example). Then calculate the person’s total height in inches, and display the results of that calculation.
Sample output:
Your height (the feet part) is 5
and the inches part is 2.5
Your total height is 62.5 inches.
Make calculations to convert the feet to meters and the inches to centimeters. Then print out the person’s total height in centimeters.