Accumulate the amount of each order immediately

Assignment Help PL-SQL Programming
Reference no: EM13311631

Calculating the Total Cost Amount

Subtask 2.1 - Your program needs to be able to calculate the total amount of all ordered items in the shopping cart. The calculation can be completed in either of two different ways;

1. Accumulate the amount of each order immediately after the items being added into the cart. For that you need to retrieve the price of a product item from PRICE_LIST in order to calculate the amount by price*quantity. (Hint: A product item and its price have exactly the same index in the respecting arrays.) In this case, the calculation will need to be implemented in the Information Gathering Component; OR

2. After completion of the Information Gathering Phase, in a loop you can visit each of the Product Codes stored in orderedProductCodeArr in order to get the index for the corresponding price in PRICE_LIST. You then access to quantityArr to retrieve the quantity. With the calculation of price*quantity, you can accumulate the amount for total orders. In this case, the calculation is implemented after the

Information Gathering Component.

Subtask 2.2 - Finding the Most Expensive Product Item in the Shopping Cart

Your program needs to be able to find the most expensive product item in the shopping cart. To do that, for each of the ordered items you need to firstly retrieve the corresponding price from PRICE_LIST, and then compare the prices one by one. Once you find out the most expensive price, the corresponding product item in PRODUCT_LIST will be the most expensive product item in the shopping cart.
Similarly, you can implement this feature either in or after the Information Gathering Component.

Subtask 2.3 - Finding the Cheapest Product Item in the Shopping Cart
Your program needs to be able to find the cheapest product item in the shopping cart. For it you may adopt the same strategy described in Subtask 2.2.

Subtask 2.4 - Calculating Average Cost Per Unit

Your program needs to be able to calculate the average cost per unit for the ordered product items in the shopping cart. This can be done by total cost divided by the accumulated value of quantities. Note that the program needs to handle "Division by Zero" exception. Only two digits after decimal point are required in display of the calculated average value.

Subtask 2.5 - Presenting the Order Information on a Table

To a table on HTML, your program needs to print out the detailed order information including product name, price, quantity, and cost. You may adopt an iteration plan to visit the elements stored in quantityArr and orderedProductCodeArr in order to get the index to retrieve the product names and prices from PRODUCT_LIST and PRICE_LIST.


Attachment:- shoppingCart-template.html

Reference no: EM13311631

Questions Cloud

Determine the investments net present value : Determine the investment's net present value, the internal rate of return, payback period and the discounted payback period and analyse the profitability of Briscoes Ltd by preparing a common-size income statement and by calculating any other ratios..
Define the highest principle quantum number : The highest principle quantum number of period 3 elements is 4. 5. Period 3 elements have six 2p electrons. 6. The valence electrons of group 2A elements are in an s subshell. 7. The valence electrons of group 5A elemnts are in the 6s subshell. 8...
What is the minimum coefficient of friction : A flat (unbanked) curve on a highway has a radius of 180{\rm m}. What is the minimum coefficient of friction that will prevent sliding
A comparative analysis of regional quality awards : Topic: A comparative analysis of Regional Quality awards
Accumulate the amount of each order immediately : Information Presenting Component. Accumulate the amount of each order immediately after the items being added into the cart. For that you need to retrieve the price of a product item from PRICE_LIST in order to calculate the amount by price*quanti..
Define type of reaction mechanism : Your lab partner is typically spot-on, but today they are having an awful day. Instead of using concentrated sulfuric acid in this exercise, they used concentrated hydrochloric acid.
What is the volume of the interior of the house : A house is 30.0 ft long and 32 ft wide, and has 8.0 ft high ceilings. What is the volume of the interior of the house
Give Pinyarat a report that identifies the key problems : Give Pinyarat a report that identifies the key problems and a plan of action she can present to her sponsor
How much time does this maneuver take : a gymnast is performing a floor routine. In a tumbling run she spins through the air, How much time does this maneuver take

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Write a script that declares a variable

Write a script that declares a variable and sets it to the count of all products in the Products table. If the count is greater than or equal to 7, the script should display a message that says,

  Convert the er/eer model

To represent a problem description given in natural language as an (Enhanced) Entity -Relationship model; to convert the ER/EER model into a relational data model;

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Create a view named customer addresses

Create a view named CustomerAddresses that shows the shipping and billing

  Create a comparison document

Create a Comparison Document

  Pl-sql block to display last name and salary

Write a PL/SQL block that displays the last name and salary of the following people. Each of these can be done separately as PL/SQL, first to test and get the output lines then encapsulated.

  Display the customerid from the orders table

Display the CustomerID from the Orders table and the sum of the associated ItemPrice multiplied by Quantity using Gross Sales (with a space) as the column name from the OrderItems table.

  Describe the meaning of keyword exists and not exists

Describe the meaning of the keyword EXISTS. Describe how any and all relate to EXISTS and NOT EXISTS. Write a query which will display names of any customers who are interested in all artists.

  Produce a diagram showing schema

Produce a diagram showing schema and the partial and transitive dependencies in your 1NF. b. Produce a diagram showing table schema and any transitive dependencies in your 2NF

  If the value for the listprice column is a negative number

If the value for the ListPrice column is a negative number, the stored procedure should raise an error that indicates that this column doesn't accept negative numbers. Similarly, the procedure should raise an error if the value for the DiscountPer..

  Can we offer an example of a query

Can we offer an example of a Query in which we can use a parentheses to affect the order of execution in which the WHERE Clause has both AND and OR Logical Operators?

  An er diagram for the system

An ER diagram for the system. Show all entities, relationships, cardinalities and optionalities. Also, include all intersection entities. You must use the Finkelstein methodology as per the study book and tutorials.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd