Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The program must meet these criteria: Must follow the standards followed in earlier programs: include meaningful comments, is formatted in an easy - to -
The program must meet these criteria:
Must follow the standards followed in earlier
programs: include meaningful comments, is
formatted in an easytoread manner, uses strict
mode to enforce good coding practices. Variables
are initialized at the beginning. Uses "const" and
"let" correctly. It does not use "var" to initializeSolve this Problem
Write a JavaScript program that solves the following
problem:
Youie buys items at the campus bookstore. A
backpack, a calculator, and a textbook.
The backpack costs $ The calculator
costs $ The textbook costs $
The bookstore charges sales tax.
What is the subtotal amount for the items?
What is the sales tax amount for the items?
What is the total cost for the items after the
sales tax is added to the subtotal?
variables. Variables are kept out of global scope by
compartmentalizing them inside functions.
Use document.getElementByld to read the prices of
the elements from the DOM: backprice, calc
price, and textprice.
Use the textContent property of the elements to
read the text contents from the DOM elements.
Convert the text content from the DOM elements
into numbers using the Number method.
Calculate the sum of the item prices.
Calculate the amount of sales tax.
Calculate the total price.
Output the following information to the console
NEEDS SEPERATE FUNCTIONS
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