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

  Suggest a learning algorithm for the problem

What is required to defi ne a well-posed learning problem ?

  What messages are sent if not well-formed

Create new DOM documents for each of your .xml file and .xsl file. Use these to generate output to the browser.

  Design diagram data warehouse using star schema

Assume that data warehouse consists of three dimensions time, customer, and cell phone plan, and two measures number of calls and cell phone bill. Sketch a schema diagram for above data warehouse using star schema.

  Find names of students who have higher gpa from table

List the students ID, name, GPA, and course Number such that all students have GPA greater than 3 . 5 and enrolled in a course in Jan 1, 2011. Find the names of all students who have GPA greater than 3.

  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.

  List course along with names of students from database table

List the courses (D-code and C-no), along with the names of the students who are currently taking them. List all the courses (D-code and C-no) that John (i.e., S-Name=''John'') got 'A' grade.

  Find that the data structure holds redundant data

Imagine that you have been hired to fulfill their need of enhancing the data repository for their current reservation processing system. Upon reviewing the system, you find that the data structure holds redundant data and that this structure lacks..

  How to change content in order for new list

To what kind of list would you change it? What would you require to change about content in order for new list type to be effective for purpose of list?

  Create database to keep information of movies

Create a database for Ray. He is interested in movies and wants to keep information on movies, actors, and directors in a database. The only user is Ray, and he needs to produce reports.

  What is bitcoin mining

Discuss BitCoin. What are they? Who made them? How long have they been around? What is BitCoin Mining? In your opinion, will BitCoins stick around? Why or Why Not?

  Create a new database and name it orders

Purpose of this hands-on computer exercise is to have you learn how to use Microsoft Access to: create a database table, enter data into the table, create a report based on the data, and print the table and the report.

  Covert the extended entity relationship diagram

Covert the Extended Entity Relationship Diagram (EERD) for Orthopedic Alliance of Plano (OAP) described in assignment one to relations. See Lecture 5, slide 22 for relational schema.

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