Question: Each array represents the sales for a region, and each element in an array represents the regions sales for one quarter. For instance, the second

Each array represents the sales for a region, and each element in an array represents the regions sales for one quarter. For instance, the second element (index 1) in the third array represents region 3s sales for the second quarter. Your job is to add event handlers that display the data in those arrays.

Each array represents the sales for a region, and each element in

Look at the JavaScript code to see that it starts with the declarations for the five arrays that are described above. Note that the values of the elements in the arrays are coded in a comma-separated list where each value is assigned to the next element in the array. So the first value in the list is assigned to the element at index 0, the second value is assigned to the element at index 1, and so on. You can use this same technique as necessary throughout this assignment.

Add an event handler for the click event of the Show Sales By Quarter button.

This handler should display the results in the text area below the Results heading in this format:

Sales by Quarter Q1: 9965 Q2: 7403

As you code this event handler and the other event handlers for this HW, try to use FOR loops to do as much of the processing as possible.

Add an event handler for the click event of the Show Sales By Region button. This handler should display the results as shown above.

Add an event handler for the Show Total Sales button. This handler should display the total sales in a single line like this:

Total sales: 39907

Sales Arrays

Use a Sales array

Results

Use a Sales array Results Sales by Region Region 1: 5355 Region 2: 9585 Region 3: 9398 Region 4: 6195 Region 5: 9374 Show Sales By Quarter Show Sales By Region

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!