Question: WEB230 JavaScript 1 Assignment 2b - Surface Area In this assignment we will write a JavaScript program to calculate the surface area of the outside
WEB230 JavaScript 1 Assignment 2b - Surface Area In this assignment we will write a JavaScript program to calculate the surface area of the outside of a box.
Submission Do not use the var keyword. Instead use let or const. Do not include any HTML tags Do not use document.write()
Notes
Output the required information to the console. The surface area of a box is calculated with the formula below. Where a, b, and c represent our 3 side lengths and area is the calculated surface area. Note that this is the math formula, not JavaScript code. area = 2ab + 2bc + 2ac
Instructions 1. Create variable containing an object that will contain three properties that store the length of each side of the box.
2. Prompt the user for 3 side lengths and store them in the properties of the object.
3. Create a function named calcArea that accepts one parameter, the object we created earlier. Using the formula below, calculate and return the surface area.
4. Use template literals (AKA back-ticks, template literals are explained in the section on Strings in Chapter 1) to display the three sides of the box and the final surface area with descriptive text.
Sample Output
Side A=3, Side B=4, Side C=5 The surface area is: 94
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
