In class exercise (I) Problem specification: An e-commerce company based in Maryland, U.S. called Dogwood, needs an online sale system. You are asked to.

Slides:



Advertisements
Similar presentations
FOUNDATIONAL KNOWLEDGE OF SELLING
Advertisements

Requirements and Design
Lesson 9 Goods and Services Tax Li, Jialong
1 Lab Session-5 CSIT221 Spring 2003 Default and Parameterized Constructors Destructors Programming Exercise for building a template based class (demo required)
CS 106 Introduction to Computer Science I 02 / 28 / 2007 Instructor: Michael Eckmann.
Copyright 2008 by Pearson Education Building Java Programs Chapter 3 Lecture 3-3: Interactive Programs w/ Scanner reading: self-check: #16-19.
1 The First Step Learning objectives write Java programs that display text on the screen. distinguish between the eight built-in scalar types of Java;
Copyright 2008 by Pearson Education Building Java Programs Chapter 3 Lecture 3-3: Interactive Programs w/ Scanner reading: self-check: #16-19.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Chapter What kinds of transactions are recorded in a purchases journal? A) Merchandise bought on account B) All cash payments C) Sale of merchandise.
Struts 2.0 an Overview ( )
PROG Mobile Java Application Development PROG Mobile Java Application Development Event Handling Creating Menus.
Chapter 1.
1 AQA ICT AS Level © Nelson Thornes ICT Systems.
1 Pattern-Oriented Design by Rick Mercer based on the GoF book and Design Patterns Explained A New Perspective on Object-Oriented Design Alan Shalloway,
LEGAL AND BUSINESS ASPECTS ON THE CREATION OF AN INTERNET PROJECT PRESENTED BY: CRISTINA.
CS1101: Programming Methodology Aaron Tan.
CS1101X: Programming Methodology Recitation 7 Arrays II.
INFO Problem Solving and Programming Logic INFO Problem Solving and Programming Logic Arrays Sorting.
© The McGraw-Hill Companies, 2006 Chapter 4 Implementing methods.
Amicus Point of Sale and Business Management System Amicus Retail.
Design. Stages of Design i.Nature of the solution 1.Agreed set of objectives 2.Output design 3.Input design 4.Data Flow Diagram 5.System Flowchart 6.Data.
How Do I Purchase Mutual Funds? Investment and Finance 12 Ms. Stewart.
CASH AND CREDIT CARD SALES
Journalizing Sales and Cash Receipts Using Special Journals
CS 350 – Software Design The Strategy Pattern – Chapter 9 Changes to software, like other things in life, often focus on the immediate concerns and ignore.
Expected value. Question 1 You pay your sales personnel a commission of 75% of the amount they sell over $2000. X = Sales has mean $5000 and standard.
Marketing Principles Unit 11  Selling Policies  Product Information  Product Features and Benefits.
Microsoft Access 2007 Tutorial (Part II) CIS*1000*DE.
Supply. NOTES 11/5 The amount of a product that would be offered for sale at all possible prices SUPPLY.
Chapter 8 Classes and Objects: A Deeper Look. The Time Object.
Objectives: Recognize the role value plays in pricing decisions Explain the goal of pricing See the value of Pricing as one of the key components of the.
C++ Functions. Objectives 1. Be able to implement C++ functions 2. Be able to share data among functions 2.
Data Structures and Algorithms Lecture 1 Instructor: Quratulain Date: 1 st Sep, 2009.
Looping and Counting Lecture 3 Hartmut Kaiser
Linked List. Iterators Operation to find a link, deleting, and inserting before or after a specified link, also involve searching through the list to.
Java Arrays and Methods MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation ©Akhilesh.
Amicus Point of Sale and Business Management System Amicus Hospitality.
PRODUCT PLACE PRICE PROMOTION EACH MARKETING PLAN OF ACTION INCLUDES THESE 4 PS Marketing is the 4 Ps.
Business Development Services 1 What are your costs? Session 10.
Homework #3: Classes and Constructors By J. H. Wang Apr. 24, 2015.
1 Advanced Programming Windows Applications. Create a new Project Select a C# Windows Application.
CS 350 – Software Design The Decorator Pattern – Chapter 17 In this chapter we expand our e-commerce case study and learn how to use the Decorator Pattern.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 9: Arrays; Revision Session.
SPONGEBOB CINEMAS INSIDIOUS KHURAFAT THE LAST SUMMER.
Chapter 11 - Introduction n Objectives –Define accounting terms related to sales and cash receipts for a merchandising business. –Identify accounting concepts.
FUNCTIONS (C) KHAERONI, M.SI. OBJECTIVE After this topic, students will be able to understand basic concept of user defined function in C++ to declare.
By SmartBoard Team. Agenda  Scenario & Writing UML  Discuss with each team’s UML  What if…  BMVV design  Strategy pattern  Applied with BMVV design.
CIS 115 All Exercises Devry University (Devry) For more course tutorials visit CIS 115 All Exercises Devry University.
CIS 115 AID Peer Educator/cis115aid.com FOR MORE CLASSES VISIT
Problem solving Chapter 3
Marketing Mix Place. Learning Objectives To understand the channels of distribution business might use when they grow To understand how distribution channels.
CIS 115 Slingshot Academy / Tutorialrank.com Tutorialrank.com For More Tutorials
CIS 115 All Exercises Devry University (Devry) FOR MORE CLASSES VISIT CIS 115 All Exercises Devry University.
CIS 115 ALL EXERCISES DEVRY UNIVERSITY (DEVRY)  CIS 115 All Exercises Devry University CIS 115 ALL ILABS DEVRY UNIVERSITY (DEVRY)  CIS 115 All iLabs.
CIS 115 AID Teaching Effectively/cis115aid.com FOR MORE CLASSES VISIT
Exercise : Write a program that print the final price of purchase at a store where everything costs exactly one dollar. Ask for the number of items purchased.
Problem specification:
CS 350 – Software Design The Strategy Pattern – Chapter 9
Chapter Nine The Strategy Pattern
CIS 115Competitive Success/tutorialrank.com
CIS 115 Education for Service-- tutorialrank.com.
Interfaces.
Chapter 5 Vocabulary Review
Problem #2: You need to take in the price of four items a customer bought, determine the total price before tax, determine the tax using the tax.
For Wednesday No new reading No quiz.
Each marketing plan of action includes these 4 ps
Other Special Features of SimPOS! Retail Point of Sale.
Journalizing Sales and Cash Receipts
Presentation transcript:

In class exercise (I) Problem specification: An e-commerce company based in Maryland, U.S. called Dogwood, needs an online sale system. You are asked to write the part of the system to deal with sale order.

Stage One Step I. Create the class library for sale order Implement the sale order class according to the following specification. Please note that this class is not responsible for getting input from users. You must assume that the information needed is passed in through its constructor. ClassAttributesOperations SaleOrdercustomName, Calculate price before tax Calculate itemSold, Calculate tax amount itemQuantity, Calculate total price unitPriceDisplay a receipt with custom name, item sold,quantity, unit price, tax amount and total price. Step II. Write an application using the sale order library Write an application to test the above class you create. Basic things you need to do are to create an object of SaleOrder and to see if the receipt is displayed properly.

First SaleOrder Design SaleOrder -itemQuantity: integer -unitPrice: double -itemSold: string -customerName: string +calTax(): double … double calcTax(){ return itemQuantity*unitPrice*0.05; }

Result of Stage One: Your library works so well for Dogwood Another two e- commerce companies based in Maryland, Elm and Holly, bought your library and used it in their on-line sale application as well.

Stage Two: Requirement changes: Dogwood’s business is booming and they decide to extend their business to Delaware. You are asked to rewrite the sale order library to deal with the taxation rule with both Maryland and Delaware.

Step I. Changing requirement leading to changing sale order library Step II. Write an application using the new sale order library Write an application to test the above class you create. Basic things you need to do are to create an object of SaleOrder and to see if the receipt is displayed properly for both Maryland and Delaware customers.

Result of Stage Two: Your library works so well for Dogwood’s business in Delaware and Maryland. You also sold your new library to an Delaware and Maryland e- commerce firm called Chestnut. Due to your change to sale order library, Elm and Holly are affected.

Stage Three: Requirement changes: Dogwood’s business is booming again and they decide extend their business to the rest of U.S. You are asked to rewrite the sale order library to deal with the taxation rule with all the states in U.S..

Step 0. Before we do anything, we need to sit back and think first.

What got us into this mess? Identify the changing part How can we make our design flexible? design Requirement changes What is changing in sale order? Implement changes without affecting the existing tax and how tax is calculated Separate changing part

New SaleOrder Design SaleOrder … -saleTax: SaleTax +calTax(): double … USTax +calTax(…): double CanadaTax +calcTax(…): double GermanyTax +calcTax(…): double > SaleTax +calcTax(…): double double calcTax(){ return saleTax.calcTax(…); }

Step 1. Implement the new sale order class according to the new design

Step II. Write an application using the new sale order library Write an application to test the above class you create. Your application should be something like: SaleOrder saleOrder1 = new saleOrder(“Joe”,“appletSeed”,10,1.0, new USTax()); SaleOrder saleOrder2 = new saleOrder(“Mary”,“roseTree”,2,25.0, new CanadaTax());

Change requirement on tax calculation on old design SaleOrder -itemQuantity: integer -unitPrice: double -itemSold: string -customerName: string +calTax(): double … App1 App2 App3 App4

Change requirement on tax calculation on new design SaleOrder … -saleTax: SaleTax +calTax(): double … USTax +calTax(…): double CanadaTax +calcTax(…): double GermanyTax +calcTax(…): double > SaleTax +calcTax(…): double App1 App2 App3 NewZealandTax +calTax(…): double App4

In class exercise (II) Problem One Specification: 1.You and your friend started a company to deliver software solution to customer problem. 2. Your first business is from Salisbury University Register’s office. They are using a class library to keep course information. Their current class library allow to sort the students list using a selection sort. 3. Now they ask you to improve the design to allow different sorting strategy being used.

Current Course Class Design Course -title: string -instructor: string -students: string[] …… +sortStudents(): void … void sortStudents(){ // selection sort of students array … } Course calcII = new Course(…); … calcII.sortStudents(); … Application

New Course Class Design Course -title: string -instructor: string -students: string[] ?????? +sortStudents(): void … void sortStudents(){ // sort of students array ?????? } Course calcII = new Course(…, new BubbleSort()); or calcII.setSortStrategy(new BubbleSort()); calcII.sortStudents(); … Application

Problem Two Specification: 1. Your second business is from Perdue Stadium Ticket Office. They asked you to write a class library to calculate ticket sale price. 2. Here are the rule for ticket sale at Perdue Stadium: -Ticket sale price consist of two parts: ticket price and sale tax. -Ticket price also varies between children, and adult.

Short sighted with quick and dirt approach Long term with solid and clear approach Your view

SaleOrder Design SaleOrder … -saleTax: SaleTax +calTax(): double … USTax +calTax(…): double CanadaTax +calcTax(…): double GermanyTax +calcTax(…): double > SaleTax +calcTax(…): double double calcTax(){ return saleTax.calcTax(…); }

BubbleSort +sort(string[]):void SelectionSort +sort(string[]):void QuickSort +sort(string[]):void > SortStrategy +sort(string[]):void Course -title: string -instructor: string -students: string[] -sortStrategy: SortStrategy +sortStudents(): void +setSortStrategy(SortStrategy): void void sortStudents(){ // sort of students array sortStrategy.sort(students); }

US +getAmt(…):doubld Canada +getAmt(…):double Germany +getAmt(…):double > TaxStrategy +getAmt(…):double TicketSale -priceStrategy: PriceStrategy -taxStrategy: TaxStrategy … +getAmt(): double double getAmount(){ return priceStrategy.getAmt(…) + taxStrategy.getAmt(…); } Senior +getAmt(…):doubld Children +getAmt(…):double Adult +getAmt(…):double > PriceStrategy +getAmt(…):double