Finding the most expensive product item in the shopping cart

Assignment Help Database Management System
Reference no: EM13331349

Information Presenting Component (Functional Requirement 5, 6)

Subtask 2.1 - Calculating the Total Cost Amount

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.

Subtask 2.6 - Presenting the Statistic Information on an Unordered List [0 Mark, but it will reflect the result of Subtask 2.1-2.4]

Your program needs to print out the statistic information (total cost, the most expensive item, the cheapest item, and the average cost per unit for the ordered product items) to an unordered list on HTML, following the same format illustrated in Figure 3.

 

Reference no: EM13331349

Questions Cloud

Calculate total income or adjusted gross income : Calculate total income or adjusted gross income on page 1 of Form 1040 and compute the federal tax liability, or determine the refund or balance due.
What is the speed of a point on the belt : A vacuum cleaner belt is looped over a shaft of radius 0.44cm and a wheel of radius 1.50cm. What is the speed of a point on the belt
How much money did the dealer make on the bid-ask spread : If a bond dealer bought a $100,000 municipal bond at 92% of par and sold it at 96% of par, how much money did the dealer make on the bid-ask spread?
Administrative or management commitment risks : Administrative or management commitment risks is one of the risks associated with commuter-based tools in e-procurement, probably for the reason of their potential impact in an e-procurement process. On the other hand, management knowledge is a trait..
Finding the most expensive 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.
Discuss the relationship between inflation and interest rate : Discuss the relationship between inflation and interest rate. Do an international relationship exist, yes no HOW?
Explain what is the minimum uncertainty : If the x-component of the velocity of an electron can be measured only to a precision of , what is the minimum uncertainty of the position of the electron in the x-direction. ( )
Minimize the current years tax liability : Minimize the current years tax liability. That is, they would like to defer income when possible and take the largest deductions possible, a practice they have followed in the past.
Implementation of information gathering component : Based on the pseudocode developed in Subtask 1.1, you are to implement the Information Gathering Component in this task.

Reviews

Write a Review

Database Management System Questions & Answers

  Create a function

Create a function that returns the day of the week for a specified date. Create a trigger that displays the message "Emp table updated" when an update to the employee table increases the employee's basic salary.

  Describe the features of a database management system

Describe the features of a Database Management System (DBMS) and its use within an organization.

  Write a recursive sql query

MCIS 630 Database Systems: -  Write a recursive SQL query that outputs the names of all subparts of the part with part-id “P- 100”.

  Solve the serious data redundancy problems

One of the many problems with data redundancy is the likely occurrence of data inconsistencies-two different initials have been entered for the teacher named Maria Cordon.)

  Create a struct data structure for each file contained

Write a password protected console-based application, which enables you to create user accounts and specify the name of the file or directory to be shared with other users.

  Find the entities from the functional requirements

Find the entities from the functional requirements. Entities can come from Nouns in the text, they may also come from forms, reports and legacy code.

  Create the primary and foreign key using a uml class diagram

Create the primary key and foreign keys using a UML Class diagram for each table and compare and contrast the key aspects that each system offers

  Calculate canonical cover for set of functional dependencies

Calculate a canonical cover for above set of functional dependencies (show each step of your derivation with an explanation).

  Submit a consolidated word document with the diagram

Create and submit a screenshot of your database diagram based on the tables, and generate the data definition language (DDL) for each table.

  Timetabling system - write an sql function

With the new UNSW timetabling system, the LIC of each course is required to specify what facilities they require in their classrooms as one of the inputs to the timetabling process. Write an SQL function to provide a list of rooms that contain a g..

  Stores a logically related database over two or more

A distributed database management system (DDBMS) stores a logically related database over two or more physically distinct locations connected by a computer network.

  Analyze the data in the database and in application exercise

To complete this assignment, you will need to do data calculations. Remember to follow good database practice here by not saving your calculations as part of the data table itself (they should appear only in your queries).

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