Question
Write a Javascript program that Allows the user to buy Pos toys as listed on the page.The page should include parallel arrays (at least two).One
Write a Javascript program that Allows the user to buy Pos toys as listed on the page.The page should include parallel arrays (at least two).One array (RichardItem) holds the names of the toys. (-7 points if no array)
var RichardItem = new Array ("Po action figure", "Master Shifu action figure", "Lord Shen action figure");
One array (RichardPrice) holds the corresponding prices for each toy.
var RichardPrice = new Array(7, 6, 5); (-7 points if no array)
Retrieve values from the parallel arrays, display the toys names/prices as shown (hint: onload). (4 points)
The user should be prompted to select a toy and a quantity. (4 points)
The page will display the total cost for that quantity of the toy chosen (by using the values from the parallel arrays). (6 points)
Webpage program should follow examples below
Initial page
Example INPUT
OUTPUT
Richard Ricardo's Kung Fu Panda Po Toy Sale Three parallel arrays will hold an toy item's name, price, and identifier. The user will make the purchase. The program will calculate the total cost. Begin Purchase 1. Po action figure 7 2. Master Shifu action figure 6 3. Lord Shen action figure 5
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