Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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?
- 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."
- After the end of the comment block, use the "strict mode" statement to turn on "strict mode".
- After the "strict mode" statement, the program must initialize all variables to their starting/initial values.
- The program uses "const" to assign unchanging values - the item prices.
- The program uses "let" to assign values that might change - the calculated total.
- 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started