Write a complete Matlab script that functions as a bank account simulator. Be sure to be complete and thorough, keeping in mind all of the syntax details and program flow ideas we have discussed this semester. Please be sure to include comments in your program as mentioned in the grading rubric, and please remember to demonstrate your working code to your instructor before you submit this program for grading. Your program script should accomplish the following objectives: When starting the program, it should ask the user for the starting balance of the account, the annual percentage rate (APR) of interest eamed for the account, and the date the account is created. This information should be recorded in the transaction log (discussed below). Once the account is set up, the program should present a user with a menu giving five possible options. You can decide how the user selects which option should be performed next, but your program should only accept valid inputs from the menu. The program should retum to this menu repeatedly until the last option is selected. The five menu options are detailed next: o The user should be able to make a deposit to the account. Selecting this option should prompt the user to enter the amount of the deposit (make sure it is valid), which should then be added to the account balance. This should be recorded in the transaction log The user should be able to make a withdrawal from the account. Selecting this option should prompt the enter the amount of withdrawal (make sure it is valid) be subtracted the account balance. should be recorded in the transaction log. Do not allow the user to withdrawal money is account under any circumstances!!! (You can decide exactly how your program handles this. Does it refuse to do the transaction? Does it allow the user to pull out the current balance the account, leaving a balance of zero? Up to you to decide.) o The user should be able to calculate interest earned on the account, using the formula provided below. Any interest earned should be deposited back into the account. This should be recorded in the transaction Only interest if the account balance starts out bigger than zero! Interest Balance x (APR as a decimal) The user should be able to apply a fee to the account. Selecting this option should prompt the user for the amount of the fee (make sure it is valid), which should be subtracted from the account balance. This should be recorded in the transaction log. A negative account balance can result from this option! o The user should be able to close the account. When this happens, ask the user for the date the account is being closed. The closing date and the closing balance should be written to the transaction log as well as a \"Thank you for your business\" message. At this time, the program should end Your program should create a transaction log of everything happening to the account from its creation to its end. Write this transaction log into an output \"xactlog.txt\" while your program is running. You are allowed some freedom in style and formatting with this log, but make sure to meet the minimum requirements for each transaction
balance = input(\'Balance: \');
APR = input(\'APR: \');
date = input(\'Date: \', \'s\');
choice = input(\'Enter your choice to do the desired transaction\ 1. Deposit\ 2. Withdrawal\ 3. Calculate Interest Earned\ 4. Apply fee to account\ 5. close the account\ \');
transactionLog = \'\';
while choice~=5
if choice == 1
amount = input(\'Amount: \');
balance = balance + amount;
transactionLog = strcat([transactionLog, num2str(amount), \' deposited.\ \']);
elseif choice == 2
amount = input(\'Amount: \');
balance = balance - amount;
transactionLog = strcat([transactionLog, num2str(amount), \' withdrawn.\ \']);
elseif choice == 3
interest = balance * APR / 100.0;
transactionLog = strcat([transactionLog, num2str(interest), \' interest earned.\ \']);
elseif choice == 4
amount = input(\'Amount: \');
balance = balance - amount;
transactionLog = strcat([transactionLog, num2str(amount), \' fee deducted.\ \']);
end
choice = input(\'Enter your choice to do the desired transaction\ 1. Deposit\ 2. Withdrawal\ 3. Calculate Interest Earned\ 4. Apply fee to account\ 5. close the account\ \');
end
if choice == 5
date = input(\'Please enter todays date: \', \'s\');
transactionLog = strcat([transactionLog, \'The account closed on \', date]);
end
transactionLog = strcat([transactionLog, \'Thank you for your business.\']);
fid = fopen(\'xactlog.txt\',\'wt\');
disp(transactionLog);
fprintf(fid, \'%s\', transactionLog);
fclose(fid);