Draw relationship diagram for arrays

Assignment Help Database Management System
Reference no: EM13331339

Against the Requirement Specification, you have made the following design to guide your implementation of the prototype. In respect wtih the two phases specified by KitchenwareCity, your program also consists of two components; Information Gathering Component and Information Presenting Component.

The first thing in the program will be two arrays, one for the list of products (namely PRODUCT_LIST in this document) and the other for the corresponding prices (namely PRICE_LIST). Thus, a product item and its price will have exactly the same index in the respecting arrays. (Hint: there is no need for an array to store the Product Codes. They can be just the index in PRODUCT_LIST .)

Task 1 - Information Gathering Component (Functional Requirement 2, 3, 4)

You first need to create two arrays; one (namely orderedProductCodeArr) to store the Product Code of ordered items; the other to store the quantity of ordered item (namely quantityArr). Just like PRODUCT_LIST and PRICE_LIST, an ordered item's Product Code and quantity will be stored at exactly the same index in the respecting arrays. A diagram defining the relationships between PRODUCT_LIST, PRICE_LIST, orderedProductCodeArr, and quantityArr has been drawn in Figure 1.

620_table.png



Figure 1: Relationship Diagram for Arrays

Subtask 1.1 - Pseudocode for Information Gathering Component 

Information Gathering Component is very important to a shopping cart system. You really want to develop a good algorithm for it. As a professional practice, you decided to first make a working plan in pseudocode before putting hands on coding implementation for the Information Gathering component. After the consultation with an experienced software engineer, you have obtained an Activity Diagram (Figure 2). Now lets decipher the flowchart and input the pseudocode as multi-line comments into the program to guide implementation.

Figure 2: Activity Diagram for Information Gathering Component

1265_table1.png

Subtask 1.2 - 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.

Subtask 1.3 - Duplicate Order Detection [Challenging task for only extensive study, no extra mark gained. You can skip the task if you like]
KitchenwareCity will appreciate it if an extra feature can be delivered to detect duplicate orders. If an ordered item has already been in the cart, the system should detect the case, and then ask for user confirmation for updating the quantity or not. If the user confirms 'Yes', the stored quantity will then be replaced by the newly entered value; otherwise, the program terminates the current product-adding process and loop back to ask user confirmation for adding a new item or not. Note that the user is not allowed to completely remove an ordered item from the shopping cart.

Task 2 - 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: EM13331339

Questions Cloud

Ecommerce business from any industry or e-business type. : Case study of an eCommerce business in which you identify a gap, and then propose an innovation to potentially improve the eBusiness.This innovation should be simple but able to make an important contribution to the customer andto the business. You c..
Give two examples of policies from recent history that can : Give two examples of policies from recent history that can be considered as keynesian intervention to economy by us government. Briefly explain how the changed role that keynesian theory ascribed to government has affecte the overall performance of t..
Find the refractive power of her glasses : A person whose near-point distance is 52cm wears a pair of glasses that are 2.2cm from her eyes. Find the refractive power of her glasses
Explain how many liters of hydrogen gas are formed : How many liters of hydrogen gas are formed from the complete reaction of 1.06mol of C? Assume that the hydrogen gas is collected at a pressure of 1.0 atm and temperature of 325K? Using C(s)+H2O(g)=CO(g)+H2(g)
Draw relationship diagram for arrays : Information Gathering Component is very important to a shopping cart system. You really want to develop a good algorithm for it. As a professional practice, you decided to first make a working plan in pseudocode before putting hands.
Explain mark the major species found in the solution : For 0.51 M HCN (Ka=6.2 x 10-10), mark the major species found in the solution. H+ , HCN , CN-, H2O , OH, Now calculate the pH of the 0.51 M HCN solution (Ka= 6.2 x 10-10).
Business operations and how critical is it to organisation : a) What activity, operation or environment is this project based on?
Explain what is the percent yield for the reaction : Acetylene gas, , burns in oxygen to produce carbon dioxide and water. If 60.4 g of CO2 are produced when 22.62 c2h2 react with sufficient oxygen, what is the percent yield for the reaction
Briefly explain why this is short run production function : At what level of employment would diminishing returns set in for the variable input?

Reviews

Write a Review

Database Management System Questions & Answers

  Show the rea diagram using microsoft word

Show the REA diagram using Microsoft Word

  Explain why data flow diagrams are developed in a hierarchy

Explain why data flow diagrams are developed in a hierarchy? What are the names of some levels in the hierarchy?

  Patients post cardiac bypass surgery

Monitor Renal Outcomes in patients post cardiac bypass surgery?

  Design database for keeping information of actors

Design a database for Ray. For each director, list his or her number and name and the year he or she was born. If the director is deceased, list the year of death.

  Propose solution capable of running on specified hardware

Propose a solution capable of running on the specified hardware platform. Your analysis should include the advantages and disadvantages of Ubuntu vs. Windows Server.

  Build the physical model

She's come to you for questions regarding connectivity to the Oracle database, which method would you advise her to use to connect to the Oracle database?

  Explain the problems associated with data redundancy

Assignment 5: Logical Design, Part II, Explain the problems associated with data redundancy as it pertains to effectively using information for reporting and analysis.

  Display the averaged measurements every time

The application uses hash tables - for a brief introduction, refer tothese slides . While the approach used by the simulator is very basic (using a dilated simulation clock), it is has been deemed sufficient for the purpose at hand.

  An academic department record point

An academic department record points earned by individual students in their classes

  Construct a data warehouse bus matrix

First construct a Data Warehouse Bus Matrix to identify the company's business processes and any likely Data Marts and design the star schema for any Data Marts you have identified.

  Explain components represented in cell using mccumber model

Suppose that the security model is required for protection of information in class. Using NSTISSC model, analyze each of cells (i.e. 27 cells related with McCumber model).

  Integrity constraint prevent-data inserted in table

Integrity constraint prevent from happening when data is inserted in table which contains this constraint? Let INSERT, UPDATE, and DELETE actions on both child and the parent.

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