Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help with the JavaScript on this! 1: Language Fundamentals SHOPPING CART Replace markup with JavaScript loop using supplied array data 2100 Create function to output

Help with the JavaScript on this!

image text in transcribed

1: Language Fundamentals SHOPPING CART Replace markup with JavaScript loop using supplied array data 2100 Create function to output single cart row Replace markup with calls to functions 5750 Create functions to calculate these values and Toe FIGURE 26 Completed Project 1 2. Examine the data file data.js. It contains four arrays that we are going to use 3. Open the JavaScript file functions.js and create a function called 4. Within functions.js, create a function called outputCartRow that has the to programmatically generate the data rows (and replace the hard-coded markup supplied in the HTML file). calculateTotal 0 that is passed a quantity and price and returns their product (i.e., multiply the two parameter values and return the result). following signature: function outputcartRow (file, title, quantity, price, total) 5. Implement the body of this function. It should use document.write ) calls to display a row of the table using the passed data. Use the coFixed 0 method of the number variables to display two decimal places. 6. Replace the three cart table rows in the original markup with a JavaScript loop that repeatedly calls this outputcartRow function. Put this loop within the chapter08-project01.js file. Add the appropriate element. Calculate the subtotal, tax, shipping, and grand total using JavaScript. Replace the hard-coded values in the markup with your JavaScript calculations. Use 10% as the tax amount. The shipping amount should be S40 unless the subtotal is above $1000, in which case it will be So. 7. 1: Language Fundamentals SHOPPING CART Replace markup with JavaScript loop using supplied array data 2100 Create function to output single cart row Replace markup with calls to functions 5750 Create functions to calculate these values and Toe FIGURE 26 Completed Project 1 2. Examine the data file data.js. It contains four arrays that we are going to use 3. Open the JavaScript file functions.js and create a function called 4. Within functions.js, create a function called outputCartRow that has the to programmatically generate the data rows (and replace the hard-coded markup supplied in the HTML file). calculateTotal 0 that is passed a quantity and price and returns their product (i.e., multiply the two parameter values and return the result). following signature: function outputcartRow (file, title, quantity, price, total) 5. Implement the body of this function. It should use document.write ) calls to display a row of the table using the passed data. Use the coFixed 0 method of the number variables to display two decimal places. 6. Replace the three cart table rows in the original markup with a JavaScript loop that repeatedly calls this outputcartRow function. Put this loop within the chapter08-project01.js file. Add the appropriate element. Calculate the subtotal, tax, shipping, and grand total using JavaScript. Replace the hard-coded values in the markup with your JavaScript calculations. Use 10% as the tax amount. The shipping amount should be S40 unless the subtotal is above $1000, in which case it will be So. 7

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

More Books

Students also viewed these Databases questions