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

  Write down advantage in storing metadata in tables

What is meant by a Metadata? How does this term pertain to a database? Write down advantage is there in storing metadata in tables?

  Explain what is the purpose of database

Explain what is the purpose of Database? The purpose of a database is to store information about certain types of objects. Give an example of two related TABLES.

  Creates a database named personnel

Write an application that creates a database named Personnel. The database should have a table named Employee, with columns for employee ID, named position, and hourly pay rate.

  Create a database design

Create a database design (schema) based on the following problem description.

  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.

  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.

  Describing the purpose of database an its functionality

Describing the purpose of database an its functionality, plus a detailed E-R diagram.

  Determine columns that make up the primary key

Carry out the following tasks below by using the correct SQL statements. Create the statements in Oracle by using the following steps (SQL > SQL commands > Enter Command). Determine the columns that make up the primary key of the l_lunch_items tabl..

  Draw at a context diagram and a level-0 diagram

Draw at a context diagram and a level-0 diagram. In drawing these diagrams, if you discover that the narrative is incomplete, make up reasonable explanations to complete the story. Provide these extra explanations along with the diagrams.

  Differentiate between the interaction types and styles

Explain the conceptual model employed in the design of these types. Describe the analogies and concepts these monitors expose to users, including the task-domain objects users manipulate on the screen.

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

  Create a program using microsoft access database

Please create a program using Microsoft Access Database. Create a system for Construction Engineering Norms. This objective for this system is to be use by the Project Management to do an estimate for the CONTRUCTION ENGINEERING works.

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