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

  Show the database development processes

Assume you were a newly hired IT Security Manager at a software development company that in the past hasn't paid much attention to security, especially in its database development processes.

  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”.

  Draw relational schema and show functional dependencies

Draw relational schema and show functional dependencies Comprehensive schema that shows existing PK and all functional, partial and transitive dependencies Detailed schema that shows existing PK and most functional, partial and transitive dependen..

  Design an er diagram to capture the given requirements

Design an ER diagram to capture the requirements. State any assumptions you have that affects your design and three-level schema architecture for the Gyan Gurukul Company that provide better security also design a data abstraction for his client ka..

  Draw dfd for placing order based on the e-r diagram

Draw a DFD (Context and Level 1) for placing an order based on the E-R diagram shown here.

  Create an actual web page document

Modify the XML document in Exercise 2 to include a namespace URL from which the elements of the XML document in Exercise 3 will be associated with. Make any changes to the XML document that are necessary as a result of the namespace URL inclusion.

  Implement a new learning management system

Its a lead a project that will implement a new learning management system for your university. You have two key tasks: Task 1: Investigate learning management software packages that are available through application service providers.

  What are the data entities of this enterprise

Consider a student club or organization in which you are a member. What are the data entities of this enterprise? List and define each entity

  Criteria selecting a life-cycle model for the project

What criteria would you use in selecting a life-cycle model for the project?

  Interface with some other dbms

Develop a RDBMS (Relational Database Management System) in Python. The RDBMS should actually be written in Python, not just interface with some other DBMS. This system should track students: Personal Data, Schedules and Grades. The system should cont..

  How the difference between an outer join and an inner join

Give a primary key for each relation. Are there any relations for which there is an alternate candidate key which you have not chosen as the primary key? Why or why not?

  Database for university keep track of its course offerings

Assume you are making a database to help university keep track of its course offerings. You might have following entities in database, as they are distinct items in real life.

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