Systems Analysis & Design Methods II Coping with complex conditions: II Coping with complex conditions: Decision tables.

Slides:



Advertisements
Similar presentations
Word Problems with Inequalities
Advertisements

Factoring Trinomials using common factors
Operations Research Assignment Problem.
Using Tic-Tac-Toe (x + a)(x + b)
Mr F’s Maths Notes Statistics 8. Scatter Diagrams.
Query Evaluation. An SQL query and its RA equiv. Employees (sin INT, ename VARCHAR(20), rating INT, age REAL) Maintenances (sin INT, planeId INT, day.
Decision Analysis April 11, Game Theory Frame Work Players ◦ Decision maker: optimizing agent ◦ Opponent  Nature: offers uncertain outcome  Competition:
Fundamentals, Design, and Implementation, 9/e COS 346 Day 8.
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
HCI 201 Week 4 Design Usability Heuristics Tables Links.
Computer Science 1620 Programming & Problem Solving.
1.9 Methods academy.zariba.com 1. Lecture Content 1.What is a method? Why use methods? 2.Void Methods and methods with parameters 3.Methods which return.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
P-value method 1 mean, σ unknown. A student claims that the average statistics textbook has fewer than 650 pages. In a sample of 52 statistics texts,
Sage CRM Developers Course
Systems and Matrices (Chapter5)
Coding for Excel Analysis Optional Exercise Map Your Hazards! Module, Unit 2 Map Your Hazards! Combining Natural Hazards with Societal Issues.
TH EDITION LIAL HORNSBY SCHNEIDER COLLEGE ALGEBRA.
Chapter 3 – Linear Systems
Object Oriented Programming Key Features of OO Approach Data encapsulation –data and methods are contained in a single unit, object –promotes internal.
Programming Logic and Design Fourth Edition, Introductory
Example 5.8 Non-logistics Network Models | 5.2 | 5.3 | 5.4 | 5.5 | 5.6 | 5.7 | 5.9 | 5.10 | 5.10a a Background Information.
SW388R6 Data Analysis and Computers I Slide 1 Central Tendency and Variability Sample Homework Problem Solving the Problem with SPSS Logic for Central.
Database Management 9. course. Execution of queries.
Engineering Fundamentals Decision Matrix Spreadsheet Tutorial 1.
Chapter 3 Making Decisions
WEEK 8 SYSTEMS OF EQUATIONS DETERMINANTS AND CRAMER’S RULE.
Quine-McCluskey (Tabular) Minimization Two step process utilizing tabular listings to: Identify prime implicants (implicant tables) Identify minimal PI.
9.5 Factoring Trinomials. 9.5 – Factoring Trinomials Goals / “I can…”  Factor trinomials.
Mathematics Numbers: Absolute Value of Functions I Science and Mathematics Education Research Group Supported by UBC Teaching and Learning Enhancement.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CS 330 Programming Languages 10 / 07 / 2008 Instructor: Michael Eckmann.
SECURE WEB APPLICATIONS VIA AUTOMATIC PARTITIONING S. Chong, J. Liu, A. C. Myers, X. Qi, K. Vikram, L. Zheng, X. Zheng Cornell University.
Today we will solve equations with two variables. Solve = figure out.
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
9-1 Quadratic Equations and Functions Warm Up Warm Up Lesson Presentation Lesson Presentation California Standards California StandardsPreview.
9-1 Quadratic Equations and Functions Solutions of the equation y = x 2 are shown in the graph. Notice that the graph is not linear. The equation y = x.
infinitely many solutions
The Software Development Process
1 : ConsistentDependentInconsistent One solution Lines intersect No solution Lines are parallel Infinite number of solutions Coincide-Same line.
Review Advanced Algebra 1.
COIT29222 Structured Programming 1 COIT29222-Structured Programming Lecture Week 02  Reading: Textbook(4 th Ed.), Chapter 2 Textbook (6 th Ed.), Chapters.
Intermediate 2 Computing Unit 2 - Software Development.
Adding and Subtracting Decimals © Math As A Second Language All Rights Reserved next #8 Taking the Fear out of Math 8.25 – 3.5.
OASIS Basics Computer Aided Negotiations of Water Resources Disputes.
Organization of statistical investigation. Medical Statistics Commonly the word statistics means the arranging of data into charts, tables, and graphs.
Today we will solve equations with two variables. Solve = figure out.
Objectives Solve special systems of linear equations in two variables.
An Object-Oriented Approach to Programming Logic and Design Chapter 5 Making Decisions.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Table of Contents Solving Quadratic Equations – The Discriminant The Discriminant is the expression found under the radical symbol in the quadratic formula.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 5 Making Decisions.
6.1 Graphing Systems Unit 3 Algebra 1. Warm Up: Graph the following equations. y = 2x + 1 x + 2y = 12.
Chapter 8 - Project Management1 Lecture 2 Today’s lecture covers the followings: 1.To study “project crashing” concept 2.LP formulation for project management.
Workplace Equity Information Management System (WEIMS) Creating and Importing Files November 18, 2014.
3.4 Solving multi-step inequalities. Is the following correct or incorrect? Explain your reasoning. x -4 >
Complex Numbers and Equation Solving 1. Simple Equations 2. Compound Equations 3. Systems of Equations 4. Quadratic Equations 5. Determining Quadratic.
Word problems that lead to inequalities
Programming Logic and Design Fifth Edition, Comprehensive Chapter 4 Making Decisions.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
infinitely many solutions
[English] language issues is the international classroom
COS 346 Day 8.
Conditions and Ifs BIS1523 – Lecture 8.
CSE341: Programming Languages Lecture 12 Equivalence
infinitely many solutions
Linear Systems Systems of Linear Equations
Lists CMSC 202, Version 4/02.
CSE341: Programming Languages Lecture 12 Equivalence
CSE341: Programming Languages Lecture 12 Equivalence
Presentation transcript:

Systems Analysis & Design Methods II Coping with complex conditions: II Coping with complex conditions: Decision tables

2Systems Analysis II Decision Tables Contents Decision Tables Example Example Context and history Context and history Possible implementations Possible implementations Evaluation & alternatives Evaluation & alternatives

3Systems Analysis II Decision Tables Example: Bank account rules I) If a client has an account for over 10 years (ay>10) and his salary is deposited on this account (sd=Y), he gets a bonus of 10000, except if his balance was negative during more than 3 months (nbm>3), in which case his bonus drops to II) The bonus is 5000 for clients who have an account for more than 3 years, except if their balance was negative for at least 1 month, in which case the bonus drops to III) No bonus is granted to anyone with a balance that has been negative for over 5 months.

4Systems Analysis II Decision Tables Example: Bank account rules variables and categories There are three variables, yielding three variable rows. For every category within a variable, the columns are split up, yielding 3 x 4 x 2 = 24 columns ay: 10 ay: 10 nbm: 5 nbm: 5 sd: Y ; N sd: Y ; N

5Systems Analysis II Decision Tables Full, unchecked table:

6Systems Analysis II Decision Tables Full, unchecked table: Remarks Contains every possible case. Contains every possible case. Marks with an x only these cases that are mentioned in the text. Marks with an x only these cases that are mentioned in the text. May contain inconsistencies. May contain inconsistencies. E.g. In our example case 15 & 16: you get both 0 and case 15 & 16: you get both 0 and J(a) means Y(es). J(a) means Y(es).

7Systems Analysis II Decision Tables Checked Table

8Systems Analysis II Decision Tables Checked Table: Remarks Maximum one value per column Maximum one value per column Solves consistency poblems. Examples: Case 15 & 16: 0:x, 2500:x -> Choose 0 Case 15 & 16: 0:x, 2500:x -> Choose 0 Reason: Sentence III explicitly states that no one, having a negative balance for over 5 months, is to have a bonus. That’s why we choose 0 and not 2500 as the bonus in case 15 & 16 Case 17: 5000:x, 10000:x -> Choose Case 17: 5000:x, 10000:x -> Choose Reason: This time, no sentence is more explicit then another. Common sense tells you to take …

9Systems Analysis II Decision Tables Checked Table: Remarks Minimum one value per column Minimum one value per column If no bonus is granted, we want this to be explicit. We want to avoid blank columns. In our table: Cases 1 to 6: no box marked -> Choose 0 Cases 1 to 6: no box marked -> Choose 0 All other boxes get hyphens. Now, every case (column) is assigned exactly one bonus.

10Systems Analysis II Decision Tables Reduced Table

11Systems Analysis II Decision Tables Reduced Table: Remarks Since we now have only one x per column, we can move the appropiate bonus-value to the column, reducing the rows. Since we now have only one x per column, we can move the appropiate bonus-value to the column, reducing the rows. Criteria that do not matter, are given a hyphen sign (-), meaning “don’t care”. Examples: Criteria that do not matter, are given a hyphen sign (-), meaning “don’t care”. Examples: Cases 1 to 8: All cases result in 0 bonus no matter what the values of nbm or sd are. The 8 colmuns are merged Cases 1 to 8: All cases result in 0 bonus no matter what the values of nbm or sd are. The 8 colmuns are merged Cases 9 & 10: Given 3 <= ay <= 10 and nbm < 1, Cases 9 & 10: Given 3 <= ay <= 10 and nbm < 1, sd is of no importance anymore … ( Premie means bonus here)

12Systems Analysis II Decision Tables Reduced Table with Optimal Condition Order

13Systems Analysis II Decision Tables Reduced Table with Optimal Condition Order: Remarks By swapping criteria, some condition testing can be avoided. Just once here: By swapping criteria, some condition testing can be avoided. Just once here: Swapping nbm and sd, reduces the categories from 4 to 3 in the case of ay > 10 Swapping nbm and sd, reduces the categories from 4 to 3 in the case of ay > 10

14Systems Analysis II Decision Tables To working code See Customer.java See Customer.java Homework: Homework: Correct possible mistakes Correct possible mistakes Try the three alternatives Try the three alternatives Invent entirely other ways to code it. Invent entirely other ways to code it. Turn the main program to a decent testing program. Turn the main program to a decent testing program.

15Systems Analysis II Decision Tables Evaluation and alternatives Problem : repetition of conditional code. Problem : repetition of conditional code. In real life, the same conditions tend to come back in different places in your code. In fact when coding conditional code, you will notice that entire structures of if-then-else nesting come back time after time. This is code repetition or copy-pasting of code, which is a maintenance nightmare.

16Systems Analysis II Decision Tables Problem: repetition of conditional code Non OO solution: Write the conditional code in a procedure once and pass function pointers to it. These function pointers enable you to call any function within the complex conditional structure. Non OO solution: Write the conditional code in a procedure once and pass function pointers to it. These function pointers enable you to call any function within the complex conditional structure. N.B. Languages who don’t support function pointers can use eval()-mechanism for evaluation of code, hidden in strings. Or they can use a special case structure to decide which code to call. N.B. Languages who don’t support function pointers can use eval()-mechanism for evaluation of code, hidden in strings. Or they can use a special case structure to decide which code to call. OO solution: Use inheritance in stead of conditions. The polymorphism mechanism removes the need to call function pointers. OO solution: Use inheritance in stead of conditions. The polymorphism mechanism removes the need to call function pointers.