Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed Example INPUT

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

OUTPUT

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions