Case Studies

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

Four Case Studies

Case study 1:
BMI Calculator
BMI Chart
BMI Calculator
• Given height (in meters) and weight (in kg) of a person
• Calculate his/her BMI
• Determine the category based on BMI //how??
Case study 2:
Calendar (Month Conversion)
Calendar Version 1
10 07 2020  10 July 2020
Calendar Problem: Month Conversion
• Input 3 info in digit: <day> <month> <year>
• Print <day>
• Determine the respective <month> in words, and print it
• Print <year>
Case study 3:
TH Hibah calculator
Hibah TH Calculation
TH is a special bank for Malaysian Hajj pilgrims
Hibah is an Islamic Dividend
Hibah Tahunan is Yearly Dividend
Hibah Haji is Hajj dividend (up to RM9,980)
Example: TH Hibah calculation
• First case: Given an average balance monthly = RM15,000
• Calculate your TH dividend :
• RM15,000 x 4.25% = RM637.5
• RM9,980 x 1.5% = RM149.7
• Total hibah: RM637.5 + RM149.7 = RM787.2

• Second case: Given an average balance monthly = RM5,000 (≤ RM9,980)


• Calculate your TH dividend :
• RM5,000 x 4.25% = RM212.5
• RM5,000 x 1.5% = RM75
• Total hibah: RM212.5 + RM75 = RM287.5
TH Hibah calculator
• Set YEAR_D = 4.25
• Set HAJJ_D = 1.5
• Input an average balance monthly, let say blnc
• myYearlyD = blnc * YEAR_D / 100
• blnc * HAJJ_D / 100, (blnc ≤ RM9,980)
myHajjD = 9,980 * HAJJ_D / 100. (blnc > RM9,980)
• myTotalD = myYearlyD + myHajjD
• Output myTotalD
Case study 4:
High Blood Pressure Monitor
Blood Pressure
Example: HBP Monitor
• Given Systolic (110) and Diastolic (110) of a person
• Determine the category //how??

120

90

70
40 60 80
Example: HBP Monitor
• Given Systolic (110) and Diastolic (110) of a person
• Determine the category //how??
• first = (90<s<120) AND (40<d<80)
120
• sec = (70<s<90) AND (60<d<80)
• Normal = first OR sec
90

70
40 60 80

You might also like