1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mr Goodwill [35]
3 years ago
10

Program: assign03a.m Write a MATLAB script file that uses principal (or amount), rate of interest, and time to compute and displ

ay the simple interest with appropriate labeling. Create a vector of rates using the following information entered from user. Ask the user to enter the low and high values for the rate range and the number of rates. Ask the user for the number of years.

Mathematics
1 answer:
DochEvi [55]3 years ago
4 0

Answer:

The code is given in the answer along with the algorithm and explanation. The output and the workspace variables are also attached as screen shots.

Step-by-step explanation:

The basic algorithm of the code is as follows:

  1. Clear the workspace, command window and prepare the format as banking.
  2. Set the constant value of principal amount, this is fixed as 4000 in the code and can be changed.
  3. Ask the user to enter the value of lowest interest rate , highest interest rate , number of interest rate  values and number of years.
  4. Create the interest rate vector.
  5. For each entry of the interest rate vector, calculate the interest.
  6. Display the each entry of interest rate and the simple calculated interest.
  7. Calculate the average rate of interest and the average interest and display them.

The code is here as follows

%% Preparing the formats

clc,clear all;%Clearing command line and workspace

format bank%Formatting

format compact%Formatting

%% Setting the constants

PRINCIPAL = 4000;%Principal amount fixed as 4000.

%% Taking inputs from the user

low_val = input('Enter the low value for the rate range: ');%Lowest value of the interest

high_val = input('Enter the high value for the rate range: ');%Highest value of the interest

rate_vals = input('Enter the number of rate values including high and low values: '); %Total number of rate values

year = input('Enter number of years: ');% Number of years

%% Creating the interest vectors

rate = linspace(low_val,high_val,rate_vals);%Creating the vector

%% Initializing the array

simple_interest=zeros(length(rate),1);%initializing the array to hold the simple interest

%% Displaying the interest rate vectors

fprintf('\t\t Rate(%%)\t\tInterest($)\n');%Displaying the  interest rate and interest heading

%% Calculating the interest vectors

for i = 1:length(rate)

   simple_interest(i) = (rate(i)*year*PRINCIPAL)/100;%Calculating Simple rate of interest for a given rate over the principal amount

fprintf('\t\t %.2f\t\t\t%.2f\n',rate(i),simple_interest(i));% Displaying each entry  interest rate and interest

end

%% Calculating and printing the average interest

fprintf('Average: Rate(%%)\t\tInterest($)\n');%Displaying the heading for average rate and interest

fprintf('\t\t %.2f\t\t\t%.2f\n',mean(rate),mean(simple_interest));%Calculating and displaying the average interest.

You might be interested in
Solve the equation<br> 4n-9=2(5+2n)
SVETLANKA909090 [29]

Answer:

There is no values to make the equation true. Please check the equation.

Step-by-step explanation:

7 0
3 years ago
Read 2 more answers
Random/probability sampling is when everyone in the group you are studying has an equal chance of participating.
zaharov [31]
Probability sampling<span> is when everyone in the group you are studying has an equal chance of participating.</span>
7 0
3 years ago
4 divided by 457. Please list the steps
exis [7]
You find out how many times 4 goes into 4 and get 1 then you find out how many times 4 goes into 5 and get 1 but you subtract 5 minus 4 and get 1 then bring down the 7 to get 17 then find out how many times 4 goes into 17 which is 4 times because 4 times 4 is 16 and you do 17 minus 16 and get 1 then add a decimal and bring down the 1 to get 10 then find out how many times 4 goes into 10 and get 2 subtract and get 2 bring down the zero turn it into 0 then you get 20 then find out how many times 4 goes into 20 and get 5 and 4*5=20 so 20-20 is 0 so your answer is 114.25
5 0
3 years ago
Read 2 more answers
a square measuring 9 inches by 9 inches is cut from the corners of a square measuring 15 inches by 15 inches what is the area of
Alexandra [31]

Answer:

Step-by-step explanation:

It would be the area of the big square minus the area of the small square.

6 0
3 years ago
PLS HELP!!! ONLY ANSWER IF U KNOW IT!!
atroni [7]

Answer:

hello,

the answer is option c (0.84)

and if you wabt to find in angle then the answer is 33.04°.

<em><u>hope</u></em><em><u> </u></em><em><u>it</u></em><em><u> </u></em><em><u>helps</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em>

7 0
3 years ago
Other questions:
  • 15 percent of what is 12
    9·2 answers
  • Can someone answer this question correctly it's my test please don't answer if you don't understand please show work I need it t
    13·1 answer
  • A triangle contains angles measuring 28 and 37 how many degrees is the third angle of the triangle
    9·2 answers
  • Help please will give brainliest thank you
    8·2 answers
  • What is the slope of the line whose equation is 2x-3y=5
    6·2 answers
  • In your sock drawer you have 6 blue, 7 gray, and 2 black socks. Half asleep one morning you grab 2 socks at random and put them
    14·1 answer
  • At the beginning of spring McKenzie planted a small sunflower in her backyard when it first planted the sunflower was 10 inches
    6·1 answer
  • A hardware store received a shipment of bolts. There were 30 cases in the shipment, containing a total of 8400 bolts. Each case
    14·1 answer
  • Please help me!! asap!!
    14·2 answers
  • Write the recurring decimal 0 32 . o as a fraction. You must show all your working
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!