Last active
August 29, 2015 14:16
-
-
Save brs14ku/237b637661dd88321199 to your computer and use it in GitHub Desktop.
CWEB 136 Assignment 2 Starter Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function processPayment($paymentAmount){ | |
$amountDue = 82.50; | |
if($paymentAmount >= $amountDue){ | |
return thankYou($paymentAmount); | |
}else{ | |
return "Thank you for your payment, you still owe $". number_format(($amountDue- $paymentAmount), 2); | |
} | |
} | |
function thankYou($paymentAmount){ | |
return "Thanks for payment of $".$paymentAmount. ". Your account is paid in full."; | |
} | |
$paymentHistory = array(); | |
echo processPayment(10); | |
echo processPayment(20); | |
echo processPayment(50); | |
echo processPayment(5); | |
print_r($paymentHistory); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment