- Create a class called
BankTransactionthat has the following properties: (2pts)
bank_namenote: example BDOtransactionnote: the value for this is 'D' for deposit or 'W' for withdrawaccount_nonote: example ACN0000001amountnote: the value for this is the amount to deposit or to withdrawsavings_amountnote: Balance amount money savings.
-
The
account_noamountand savings_amount property should beprivate. And savings_amount default is 10000. (2pts) -
Create a constructor that takes in the bank_name,transaction,account_no and amount as arguments and sets the values of the properties. (3pts)
-
Create a method called
getInfothat will show the following: (3pts)Bank Name: BDO Customer Account No: ACNO0000001 Type of Transaction: W Current Balance: 10000 Amount: 3000
-
Create a method called
newBalancethat returns the new balance after deposit or withdraw (4pts) -
Create 3 new instances/objects of the
BankTransactionclass and call thegetInfoandnewBalancemethod (5pts)
Sample Output:
Object: customer1
Bank Name: BDO
Customer Account No: ACNO0000001
Type of Transaction: W
Current Balance: 10000
Amount: 3000
New Balance: 7000
Object customer2
Bank Name: BPI
Customer Account No: ACNO0000002
Type of Transaction: D
Current Balance: 10000
Amount: 3000
New Balance: 13000
Object customer3
Bank Name: METROBANK
Customer Account No: ACNO0000003
Type of Transaction: AB
Current Balance: 10000
Amount: 3000
Unable to process this transaction! Invalid Transaction type!
- Create a class called
StringUtilitythat has the following static methods:
-
shout($string)- Takes in a string and returns it in all uppercase letters with an exclamation mark added to the end. 3pts -
whisper($string)- Takes in a string and returns it in all lowercase letters with a period added to the end. 3pts -
repeat($string, $times)- Takes in a string and a number and returns the string repeated the specified number of times. Use a default value of2for the$timesparameter. 4pts
- Create a new instance of the
StringUtilityclass and call each of the methods on it. 5pts
- You can use the
strtoupperandstrtolowerfunctions to convert a string to uppercase or lowercase. - You can use the
str_repeatfunction to repeat a string a certain number of times.
ex.
shout('Hello World');
whisper('Hello World');
repeat('Hello World'); //default is 2x
repeat('Hello World',5);
Sample output:
HELLO WORLD
hello world
Hello World Hello World
Hello World Hello World Hello World Hello World Hello World