Question
A. Modify example202.html file. (20 points) 1. Print out the initial balance, and allow user to type-in the name and the price of item the
A. Modify example202.html file. (20 points)
1. Print out the initial balance, and allow user to type-in the name and the price of item the user want to buy by sing prompt() function.
2. When user does not have enough money to buy an item, the program will print out this message:
You want to buy a tv for $500 Your current balance is $300 You do NOT have enough money!! =========================
3. Add confirm() message to ask if user wants to continue shopping or not. If yes, user will be able to type-in item and price again. If not, the program ends.
Here are program outputs:
Your starting balance is $1000 ========================= You bought a tv for $300 Current balance is $700 ========================= You bought a tv for $400 Current balance is $300 ========================= You want to buy a tv for $500 Your current balance is $300 You do NOT have enough money!! =========================
example202.html 1 3Step 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