Nataliia's Function Demo
Three kinds of functions: math calc, text manipulation, and HTML return.
________________________________________________
1) Math Function: addTax($price, $rate)
Before addTax: price = $19.99
Returned total (6% tax): $21.19
Original price is unchanged (passed by value): $19.99
________________________________________________
2) Text Function: textReport($text)
Original: " hello from LANSING COLLEGE "
Trimmed Title Case: "Hello From Lansing College"
Vowel Count: 8
________________________________________________
3) HTML Function: noticeCard($title, $body)
Success!
Your functions are working great.
Reminder
Keep examples short, clear, and consistent.
________________________________________________
Bonus) By-Reference Example: bump(&$n, $amount)
Before bump: n = 10
After bump(&n, 5): n = 15
________________________________________________
End of demo.