Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Directions: You are provided an HTML program. Your responsibility is to insert the appropriate JavaScript statements in the correct locations that will solve the problem

Directions:

You are provided an HTML program. Your responsibility is to insert the appropriate JavaScript

statements in the correct locations that will solve the problem discussed below, You are also to comment the html file with the requested information per the requirements.

Problem to solve:

The meteorology department wants to provide a webpage that will allow users to submit monthly rainfall amount for one year by month. They need you modify the html code provided to:

Read the values entered into the web page

o If a negative number is entered, use the value to zero (0).

o You can assume that rainfall amounts will be entered in whole numbers

Calculate the total rainfall for the year

Calculate the average rainfall for the year

2

Identify the month with the most rain

Identify the month with the least rain

Place the results into the correct text boxes.

Requirements:

For this assignment;

1. You will generate HTML comments to add your name, section, and TA name. This will (should) NOT be visible in the document on the web browser. This is the only HTML you will create.

2. Your assignment is to create the JavaScript to calculate the values as described above and insert it into the TML.

3. You will create and utilize one (1) array to hold the monthly values, at least two (2) functions, and at least one (1) loop which utilizes the array in your solution.

4. Modify the html button element to execute your JavaScript.

5. Utilize JavaScript comments to explain the steps you are preforming within your code. A JavaScript comments form is: /* Place your comment between the stars */

6. Variable names should be descriptive. For example, if a program is calculating the total charge for a bill at a restaurant, it may have a variable named tipAmount. A sample of the webpage you will be modifying looks like:

Additional Information:

Since the contents of a textbox, is going to be used in mathematical operations. Textboxes sometimes treat input as Strings. Use the function parseInt() to convert the String text to a number. Otherwise your calculation operations will not perform as expected. JavaScript provides several math utilities. The Math.round() method rounds a number to a specified decimal place.

The code to fix is here

Assignment 8

Rainfall Measurement Page

Thank you for participating in our study

Please enter your information and click the submit button
Note: measurements are inches and entered as whole numbers

January
February
March
April
May
June
July
August
September
October
November
December
Total Rainfall
Average Rainfall
The month with the most Rainfall
The month with the least Rainfall

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data 29th British National Conference On Databases Bncod 2013 Oxford Uk July 2013 Proceedings Lncs 7968

Authors: Dan Olteanu ,Georg Gottlob ,Christian Schallhart

2013th Edition

3642394663, 978-3642394669

More Books

Students also viewed these Databases questions

Question

How are the work breakdown structure and change control connected?

Answered: 1 week ago

Question

10. Describe the relationship between communication and power.

Answered: 1 week ago