← Back
Code Challenge 6 - Inches to Height Calculator
Introduction
This calculator code challenge is deceivingly more challenging than the previous challenges. The formula for this calculator makes use of the modulus operator (%). Remember, the modulus operator, or mod for short, performs division and returns the remainder.
This calculator converts the user’s height in inches and converts it to feet and inches. For example, I’m 70 inches tall. That means I’m 5 foot 10 inches.
Skills to Practice
- Prompting a user for input
- Saving user input to variables
- Performing a calculation using the modulus operator
- Formatting output using variables
Challenge Tasks
- Create a console project named CodeChallenge6HeightToInches.
- Complete the folowing tasks:
- Prompt the user to enter their height in inches.
- Convert the height in inches to feet and inches.
- Output the result to the user.
Sample Output