Question: Create the checking_account.class.php file and define the CheckingAccount class using the details below: 2. Inside the Lab07 folder, create a new PHP file named checking_account.class.php
Create the checking_account.class.php file and define the CheckingAccount class using the details below: 2. Inside the Lab07 folder, create a new PHP file named checking_account.class.php and then define a new class named CheckingAccount. Define the CheckingAccount class according to the UML diagram above. Please note this account needs to extend the Account class. 3. The constructor should accept the same four parameters of the Account class constructor. Besides initializing the four class attributes with the local parameters, the constructor also initializes transaction_count to 0. 4. The deposit method makes a deposit by calling the deposit method defined in the parent class. If the deposit is successful, the method needs to increase the transaction count by 1 and returns true; returns false otherwise. 5. The withdraw method makes a withdrawal by calling the withdraw method defined in the parent class. Withdrawal is allowed only if the current balance is no less than the withdrawal amount. If the withdrawal is successful, the method also needs to increase the transaction count by 1 and returns true; returns false otherwise. 6. The write check method functions the same as the withdraw method. You may simply call the withdraw method without repeating the code. 7. The getTransactionCount method simply returns the transaction count. 8. The addTransaction method needs to increase the transaction count by 1. 9. The toString method displays details of the checking account, including the account owners name, number, type, current balance, and the total number of transactions.
code in PHP
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
