Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pls help with matlab problem. ALL conditional functions are BANNED. Function Name: numberWorker Inputs: 1. (double) Mx4 array of loan amounts (principal) 2. (double) Mx4

image text in transcribed

image text in transcribed

Pls help with matlab problem. ALL conditional functions are BANNED.

Function Name: numberWorker Inputs: 1. (double) Mx4 array of loan amounts (principal) 2. (double) Mx4 array of interest rates (percent) 3. (double) Mx4 array of duration of loans (number of years) 4. (double) Amount representing interest goal Outputs: 1. (double) 1x4 vector representing total expected interest from loans in each quarter 2. (char) Sentence describing how many quarters goal was made Topics: (array math operations), (formatted strings), (masking) Background: You have landed a big job at Bank of Buzz after graduating from Georgia Tech. In an effort to impress your boss (and maybe get a raise), you decide to use your MATLAB skills to help loan profit analysis on the loans that the bank issued this year. Function Description: You are given 3 arrays, each column representing one of the 4 quarters in a business year. The first array (input 1) contains records of all of the loans that the bank gave out in a year (P in the formula). The second array (input 2) contains the interest rates for the corresponding loans given in percentages (r in the formula). Finally, the third array (input 3) contains the time that the loan was out for (t in the formula). Using the simple interest formula shown below, calculate the interest that the bank earns per loan (store this output in an array). I = Prt After you have calculated the interest, produce a sum for each column of the interest array. This gives you the total interest per quarter vector (output 1), round this value to 2 decimal places. Count how many quarters the bank met or exceeded their quarterly interest goal, calculate the total interest for the entire year (round to the nearest cent) and output a string with the following format (output 2): 'The bank reached their goal quarters out of the year. The total expected interest is $.' Example: loans = [2000 5000 1050 3250 500 30000 100 6600; 5100 100000; 0 25000] intRates = [ 7.5 12.5 50 5; 16.6 10 14 4; 40 5 02] time = [5 10 1 30; 5 10 15 20; 3 30 010] goal 10,000 bankStatement] numberWorker (loans, [expIntQuarterly, intRates, time, goal) expInt Quarterly [2221, 54500, 10760, 94900] bankStatement = 'The bank reached their goal 3 quarters out of the year. The total expected profit is $162381.50.' . . Notes: Interest rates are given in percent form, so you must convert to a decimal before plugging in the formula. When displaying your yearly output in the sentence, ensure it is not in scientific notation and only 2 values are displayed after the decimal. (ex. $162381.50 rather than $162381.50 or 1.6238e+05) The yearly profit MUST be displayed as it is in the example, do not display in scientific notation or with any more than 2 decimal places. Your first output will likely display in scientific notation, this is okay. Remember, P = principal amount, r = interest rate, t = time (in years), I = interest Make sure to calculate the yearly total by summing the rounded quarterly totals. O . Hints: . If your string output looks off, remember that %d is not always the right choice for numeric values in the sprintf() function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions