Skip to content

Instantly share code, notes, and snippets.

@brs14ku
Last active August 29, 2015 14:16
Show Gist options
  • Save brs14ku/237b637661dd88321199 to your computer and use it in GitHub Desktop.
Save brs14ku/237b637661dd88321199 to your computer and use it in GitHub Desktop.
CWEB 136 Assignment 2 Starter Code
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