Question: In this activity, you will create a MATLAB class representing a simple Bank Account. The class will encapsulate the concept of a bank account, allowing
In this activity, you will create a MATLAB class representing a simple Bank Account. The class will encapsulate the concept of a bank account, allowing operations such as depositing, withdrawing, and checking the balance.
Requirements
Create a class named BankAccount.
The class should have two properties: AccountNumber a string and Balance a double
Include a constructor method that initializes the AccountNumber and sets the Balance to zero.
Implement methods for deposit amount withdraw amount and getBalance
Ensure that the withdraw nethod does not allow the balance to go negative.
Instructions
Write the class definition in MATLAB using the guidelines provided.
Create an instance of the BankAccount class and test all the methods.
Submit your MATLAB script file containing the class definition and the test script.
Evaluation Criteria
Correct implementation of the class structure and methods.
Proper handling of the balance checks in the withdraw method.
Clarity and readability of the code.
Successful demonstration in the test script.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
