Created
September 15, 2017 13:07
-
-
Save JacquesInnocent/03a0e94a61450e6405217077f850aaa9 to your computer and use it in GitHub Desktop.
Customer transaction details and identity.
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
<?php | |
class BankAccount { | |
private $balance = 100000; | |
public function DisplayBalance () { | |
return 'Balance:'.$this->balance; | |
} | |
public function Deposit ($amount){ | |
$this->balance + $amount; | |
echo 'Your new balance is: ';$this->balance; | |
} | |
public function Withdraw ($amount) | |
{ | |
if (($this->balance) < $amount) { | |
echo 'Transaction Declined'; | |
} else { | |
$this->balance = $this->balance - $amount; | |
} | |
$user = new BankAccount; | |
$user->Withdraw(10000); | |
echo $user->DisplayBalance(); | |
$user->Deposit(20000); | |
echo $user->DisplayBalance(); | |
}} | |
class UserIP { | |
public function UserIP() { | |
$ip_address = $_SERVER['REMOTE_ADDR']; | |
echo 'User IP Address is: ';$ip_address; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment