- Display of Toys - A display of a few toys on a single web page with their name, image and price and a drop down menu to allow the user to select a desired quantity of each toy.
The AddToCart() function should do the following:
- Store the name of each toy, quantity and sum (calculated by quantity*price) in three global arrays name,quantity and sum. where itempriceID and itemNameID are the id’s of the HTML elements which display the price and name of each toy.
The ViewShoppingCart() function should do the following:
- Display the contents of the user’s shopping cart in the form of a dynamically generated table.
- Each row of the table should display the name of the toy, the quantity, the price and the sum (quantity*price) that is present in the shopping cart.
- Finally the total price of all toys in the shopping cart should be displayed at the end of the table. You can display the shopping cart on the same page as the toys.
The ViewCart() function should do the following:
- Iterate (loop) through the three arrays name,price and sum and display the elements of the three arrays in the cells of a dynamically generated table. The total sum of the shopping cart should also be displayed somewhere at the end of the table.