Question: follow the instructions I need code too HTML, javascript Modify example 1. Print out the initial balance 2. Allow user to type-in the name and

follow the instructions I need code too HTML, javascript

Modify example

1. Print out the initial balance

2. Allow user to type-in the name and the price of item (using prompt() function).

3. 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!! =========================

4. 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!! =========================

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!