Question: Question 5. 20 points. Everything in this question should go in the q5 folder. The file should be named index.html. Make the title of this
Question 5. 20 points. Everything in this question should go in the q5 folder. The file should be named index.html. Make the title of this page: (Your Name)s Nearest Integer. This is essentially a rounding application. Assume you are given a number with values after the decimal point, such as 3.14. Is 3.14 nearest to 3 or 4? Your program should figure this out. You can get the lower integer of any positive floating point value using parseInt. You can get the higher integer by simply taking the lower value and adding 1. Determine which integer (higher or lower) is closer to your value and print that result. Include the necessary html documentation using comments. Make sure that you include your name, class number, section number, and the date. Create these empty div element(s) on the screen: results Put one input text boxes on the screen and a button. Label the first box as Enter the first number. Put a button on the screen with the text that reads Determine the nearest integer. When the user enters a floating-point number and clicks the button, the results div box should determine the nearest integer. The nearest integer is 3. To make this problem a little easier, assume that you will only be given a positive number. There is a function called Math.round that does this problem for you, but I want to see if you can figure it out for yourself without using this function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
