skip to Main Content

Enter the average.html text from Figure 17.12 into a new Web page, then load thi

Enter the average.html text from Figure 17.12 into a new Web page, then load this page to verify that it behaves as described. What happens if you click on the button without entering any numbers in the text box? Calling the split method on an empty string produces an empty array, i.e., an array with length 0. Thus, clicking the button in this page without entering any numbers will result in a call to the Average function with an empty array as input. When the function attempts to calculate the average of an empty array, a division by zero occurs, causing the function to return NaN. Modify the Average function so that it returns 0, rather than NaN, if its input is empty. Then verify that your average.html page displays 0 for the average if the user leaves the text box empty?

GET HELP WITH THIS ASSIGNMENT TODAY

Clicking on this button will take you to our custom assignment page. Here you can fill out all the additional details for this particular paper (grading rubric, academic style, number of sources etc), after which your paper will get assigned to a course-specific writer. If you have any issues/concerns, please don’t hesitate to contact our live support team or email us right away.

Back To Top