Calculate Height

Write a program 05-CalculateHeight that asks the user to enter their height in two parts, first just the feet part, and then the inches part. It should then calculate their total height in inches and display that result. Finally, it should add one inch to the total height in inches and display that new value for the user.

Sample interaction:

Please enter your height, just the feet part: 5
... and now enter the inches part: 7
Your total height is 67 inches
If you grow another inch, you'll be 68 inches tall!

Instructions

  1. After logging into repl.it, click "+ new repl", and select "HTML, CSS, JS" for your environment. A random name will be given to your project, but you should change it to this: 05-CalculateHeight

  2. We're only going to use the HTML file index.html for this exercise, and write our JavaScript in the body of that file (between the <body> and </body> tags). Remember to put a <script> tag before your code, and a </script> tag after your code.

  3. Have the user enter their height in two parts--feet and inches--using the prompt() function. (Remember, the prompt() function gets string values, so you'll have to convert input to numbers.)

  4. Use the document.write() function to print out a message to the user that looks something like the one shown above. Remember, if you want to print text on separate lines, you'll need to use JavaScript to also send a <br /> tag at the end of every line you want displayed.

Finishing Up

Once your program is working correctly, use your mouse to click-drag over the URL address for your project at the top of the browser window. Copy that link, and give that copied link to the instructor using the procedure given in class.