Question: JavaScript There are several objectives for this assignment: You will use a comment block to document the author and purpose of the JavaScript file. You

JavaScript

There are several objectives for this assignment:

  • You will use a comment block to document the author and purpose of the JavaScript file.
  • You will use the "strict mode" statement to help enforce good programming practices.
  • You will use the "let" keyword to declare a variable and set a value.
  • You will use the "const" keyword to declare a variable and set a value.

Instructions

Write a JavaScript program that solves the following problem:

Youie buys 5 items at the campus bookstore: A backpack, a calculator, a ruler, a textbook, and a candy bar.

The backpack cost $56.99. The calculator cost $104.89. The ruler cost $4.32. The textbook cost $51.97. The candy bar cost $1.99.

What is the total cost of the 5 items?

  1. The scripts.js file must begin with a multi-line comment block that includes your name, and a description of the program. Use the following description of the program: "This program will add up the cost of several purchased items."
  2. After the end of the comment block, use the "strict mode" statement to turn on "strict mode".
  3. After the "strict mode" statement, the program must initialize all variables to their starting/initial values.
  4. The program uses "const" to assign unchanging values - the item prices.
  5. The program uses "let" to assign values that might change - the calculated total.
  6. The program does not add up the total at this time. You don't need to do any math for this assignment.

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!