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
Probability that carbon emissions beyond permissible level and test predicts it
sergey [27]
Probability that carbon essissions beyond permissible level and test predicts did it
5 0
3 years ago
Simplify without using the absolute value sign<br><br> | x- ( - 18) | if x &gt; - 18
slega [8]
The expression would be > 0.

Subtracting a negative is the same as adding a positive; therefore -18--18 = -18+18 = 0.  Since we know that x>-18, 0 is below anything we could get from this.
7 0
3 years ago
Here is the question !
Delvig [45]

Answer:

Step-by-step explanation:

Co-ordinates of F, G and H are:

F (-4, 5)

G (1, 10)

H (-9, 10)

You can find the lengths of sides by using the distance formula:

<em>length</em>(FG) = \sqrt{(x_{2}-x_{1})^{2} + (y_{2}-y_{1})^{2}} = \sqrt{(1-(-4))^{2} + (10-5)^{2}} = 5\sqrt{2} units

Similarly,

<em>length</em>(GH) = 10 units

<em>length</em>(HF) = 5\sqrt{2} units

Hence, perimeter will be:

P = <em>length</em>(FG) + <em>length</em>(GH) + <em>length</em>(HF) = 10(\sqrt{2} + 1) units

3 0
3 years ago
Help me guys please need to finish this ASAP
mezya [45]

Answer:

B Wednesday

Step-by-step explanation: Don't cheat on nwea btw

6 0
2 years ago
Read 2 more answers
Adiya said that the first step to solving the quadratic equation x2 + 6 = 20x by completing the square was to divide 6 by 2, squ
vivado [14]

Adiya’s method is not correct. To form a perfect square trinomial, the constant must be isolated on one side of the equation. Also, the coefficient of the term with an exponent of 1 on the variable is used to find the constant in the perfect square trinomial. Adiya should first get the 20x term on the same side of the equation as x2. Then she would divide 20 by 2, square it, and add 100 to both sides.


5 0
3 years ago
Read 2 more answers
Other questions:
  • What is x if 5x = 30?
    5·2 answers
  • To convert a capacity of 2.6 gallons to quarts which ratio would you multiply by remember that 1 gallon = 4 quarts.
    6·1 answer
  • I need help please! thanks :)
    14·1 answer
  • Identify the segments that are parallel, if any, if FDC = GCH
    14·2 answers
  • A part-time house cleaner made $9258.13 last year. If he claimed himself as an exemption for $3650 and had a $5700 standard dedu
    9·2 answers
  • Kyle is a basketball player. His bottle was full at the beginning of the game. At the end of the first quarter, he drank 5/7 of
    7·1 answer
  • This subject is hard enough why they have to make it harderrrrrrr-
    5·2 answers
  • PLEASE HELP!!
    15·1 answer
  • Solve for x.<br> -42 - 3 = -11<br> pls and thank you:)
    5·2 answers
  • Please procedure and solution <br><br>2 x |-6|-3 x |2|+|-14|=​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!