Decision: Action based on condition

Slides:



Advertisements
Similar presentations
If Function Determine action based on condition. Examples Simple condition: –If total sales exceeds $300 then applies 5% discount; otherwise, no discount.
Advertisements

Work with Data and Decision Structure. Murach’s Java SE 6, C3© 2007, Mike Murach & Associates, Inc. Slide 2.
IF Function Decision: Action based on condition. Examples SF State Tuition calculation: – Fees_and_Expenses.
Copyright © 2008 Pearson Education Canada 1-1 Chapter 1 Review of Arithmetic Contemporary Business Mathematics with Canadian Applications Eighth Edition.
Pricing in Sales and Distribution (SD)  Companies have developed numerous pricing and discount strategies—some unencumbered by any logical methodology.
Nested IF and Complex Condition. Nested IF Example: –Rules to determine bonus: JobCode = 1, Bonus=500 JobCode = 2, Bonus = 700 JobCode = 3, Bonus = 1000.
VB.Net Introduction - 2. Counter Example: Keep track the number of times a user clicks a button Need to declare a variable: Dim Counter As Integer Need.
IF Function Decision: Action based on condition. Examples SF State Tuition calculation: –
Chapter 5 Spend Wisely.
Work with Data and Decision Structure. Slide 2 Note: String and Date are classes.
Spreadsheets Spreadsheets. What is a spreadsheet? A spreadsheet is a program used for performing calculations on tables of numbers. It can also often.
Decision Structure - 1 ISYS 350. Decision: Action based on condition Examples Simple condition: – If total sales exceeds $300 then applies 5% discount;
Expression and Decision Structure ISYS 350. Performing Calculations Basic calculations such as arithmetic calculation can be performed by math operators.
Decisions Action based on condition. Examples Simple condition: –If total sales exceeds $300 then applies 5% discount; otherwise, no discount. More than.
Income Tax Arithmetic. Income Tax The table shows the tax rates in force at the present time. Rate of TaxTaxable Income Lower rate 20%£1  £2 500 Basic.
Decision Structure - 1 ISYS 350. Decision: Action based on condition Examples Simple condition: – If total sales exceeds $300 then applies 5% discount;
Functions BUS 782. What are functions? Functions are prewritten formulas. We use functions to perform calculations. Enclose arguments within parentheses.
Problem solving Chapter 3
IF Function Decision: Action based on condition. Examples SF State Tuition calculation: –
Lesson 8.3B: Markup and Discount Change each percent into a decimal  5.5%  10.24%  29% .1%  1%  50%  5%    0.29   0.01.
Payroll Computations, Records, and Payment Section 2: Calculating Earnings and Taxes Chapter 10 Section Objectives 2.Compute gross earnings of.
Payroll Computations, Records, and Payment Section 2: Calculating Earnings and Taxes Chapter 10 Section Objectives 2.Compute gross earnings of employees.
Comparing and Conditional Expressions Prepared by: IT Group Last modified: Apr 07, 2009 Section 04.
Standard Mrs. Morrey Financial Literacy Riverton High School
Hit a Homerun with Calculations
Chapter 3 Taxes in Your Financial Plan McGraw-Hill/Irwin
Warm-up: Mental Math and Estimation
Lapointe Productions Net Pay and Income Tax
Tax Preparation Financial Literacy.
ANALYSIS AND ALGORITHM DESIGN - III
Decision Structure ISYS 350.
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.
Generic Note Receivable Entries in T Accounts
Decision Structure - 1 ISYS 350.
JOE WORKED 40 HOURS THIS WEEK. HE EARNS $15.75 PER HOUR
Discount, sale price, tax, Tip
Learning Objectives Calculate Gross Pay, Employee Payroll Tax Deductions for Federal Income Tax Withholding, State Income Tax Withholding, FICA (OASDI,
SECTION 2-2 pp State Income Tax.
PAYMENT SYSTEMS SLIDE 7.
Calculations All Sections.
Hosted by Ms. Appel.
Unit 8 Income Terms & Definitions
Lesson 7.6: Markup and Discount
© 2015 Cengage Learning. All Rights Reserved.
CIS 115 Possible Is Everything/snaptutorial.com
Understanding Income and Taxes
Chapter 20 THE PAYROLL.
Decision Structure - 1 ISYS 350.
Steph’s calculations Fall 2018.
Work with Data and Decision Structure
Southern University of Utah
Decision Structures ISYS 350.
Lapointe Productions Net Pay and Income Tax
Chapter 8 Income and Taxes
PAYG Deductions Other considerations HELP Tax Offsets Allowances
Spreadsheet Review.
Compensation Programs
Decision Structure - 1 ISYS 350.
Functions BUS 782.
The cost of University How much will you repay?
Decision Structure - 1 ISYS 350.
LESSON 12-1 Preparing Payroll Time Cards
COMPENSATION.
Payroll Accounting $ $ $ $ Making Accounting Relevant Chapter 12
Overtime and Subsidy Pay Training
Presented By: Insert Name(s)
Logical tests.
Logical tests.
Fiscal Literacy.
1. Earning and managing money
Presentation transcript:

Decision: Action based on condition IF Function Decision: Action based on condition

Examples SF State Tuition calculation: PG&E electric charges: http://www.sfsu.edu/~bulletin/current/fee.htm Simple condition PG&E electric charges: http://www.pge.com/myhome/myaccount/charges/ More than one condition

Examples Simple condition: More than one condition: Complex condition: If total sales exceeds $300 then applies 5% discount; otherwise, no discount. More than one condition: Taxable Income < =3000 no tax 3000 < taxable income <= 10000 5% tax Taxable income > 10000 15% tax Complex condition: If an applicant’s GPA > 3.0 and SAT > 1200: admitted

Comparison Less than: < Less than or equal: <= Greater than: > Greater than or equal: >= Equal: = Not equal: <> At least: >= At most: <= No more than: <= No less than: >= A comparison returns True/False.

IF Function =IF(condition, ValueIfTrue,ValueIfFalse) Example: Tuition: If total units <= 12, then tuition = 1200 Otherwise, tuition = 1200 + 200 per additional unit In Cell C2: IF(B2<=12, 1200, 1200+200*(b2-12))

Example: Compute weekly wage Example: Compute weekly wage. Overtime hours are paid 50% more than the regular pay. In Cell D2: If(C2<=40, B2*C2, B2*40 + 1.5*B2*(C2-40))

Example: Tax rate is based on married status: Single: 15% Married: 10% In D5: If(B5=“S”,$C$1*C5, $C$2*C5)

Example: A restaurant charges service fee based on this rule: 15% of the check amount with a minimum of $2.

Exercises 1. The average of two exams is calculated by this rule: 60% * higher score + 40% * lower score. 2. An Internet service provider offers a service plan that charges customer based on the following rules: The first 20 hours: $10 Each additional hour: $1.5

Nested IF Example: Rules to determine bonus: JobCode = 1, Bonus=500 JobCode = 2, Bonus = 700 JobCode = 3, Bonus = 1000 In C2: If(B2=1, 500, If(B2=2, 700, 1000))

1 JobCode= 1 Or <> =1 2 JobCode=2 Or <> 2 3

Example Electric Company charges customers based on KiloWatt-Hour used. The rules are: First 100 KH, 20 cents per KH Each of the next 200 KH (up to 300 KH), 25 cents per KH All KH over 300, 30 cents per KH In C2: If(B2<=100, .2*B2,If(B2<=300,.2*100+.25*(B2-100),.2*100+.15*200+.3*(B2-300))

What if we have more than 3 conditions Example: Bonus JobCode = 1, Bonus = 500 JobCode = 2, Bonus = 600 JobCode = 3, Bonus = 700 JobCode = 4, Bonus = 800 JobCode = 5, Bonus = 1000 … Other functions: Table lookup

Example State University calculates students tuition based on the following rules: State residents: Total units taken <=12, tuition = 1200 Total units taken > 12, tuition = 1200 + 200 per additional unit. Non residents: Total units taken <= 9, tuition = 3000 Total units taken > 9, tuition = 3000 + 500 per additional unit.

Units <= 12 or Not Resident or Not Units <= 9 or Not