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
Avery is currently making $14 per hour at her job. Her boss gives her a 15% raise for showing good work ethic.
sattari [20]

Answer:

C)  $84

Step-by-step explanation:

40 x 14 = 560

she made $560 prior to raise

14 x 1.15 = 16.10

her new hourly rate is $16.10

40 x 16.1 = 644

she now earns $644 per week

644 - 560 = 84

4 0
3 years ago
How to write the number in 4different ways
mario62 [17]
Lets say the number is 155:

100 + 50 + 5

one hundred and fifty-five

155

idk the last one tho

there should be only 3 ways, plz double check

3 0
3 years ago
several students were surveyed about their favorite class. the results are shown in the table. What fractionof the students chos
Anettt [7]

Answer:

art class / all classes = 16 / (26 + 19 + 21 + 16 + 32) = 16/114 = 8/57Step-by-step explanation:

7 0
3 years ago
Find the distance between each pair of points <br>L(-7,0) ,Y(5,9)​
Sedbober [7]

Answer:  The distance is 15

Step-by-step explanation:

To find the distance between L and Y find the difference in the x and y coordinates then square them and add them to find their square root.

-7-5= -12

0-9 = -9

12^2 + 9^2 = d^2   where d is the distance

144 + 81 = d^2

225 = d^2

d= \sqrt{225}  

d= 15

3 0
3 years ago
1. -222=-2x-3(4x+18)<br>2. 154=2x-6(-2x-14)<br>solve for x​
Aleksandr [31]

Answer:

1. x = 12

2. x = 5

Step-by-step explanation:

1. -222 = -2x - 12x - 54

-222 = -14x - 54

-168 = -14x

x = 12

2. 154 = 2x + 12x + 84

154 = 14x + 84

70 = 14x

x = 5

4 0
3 years ago
Other questions:
  • Please help. I’ll mark you as brainliest if correct!
    14·1 answer
  • In order to solve the equation -3x-6=5, the first step is to
    15·1 answer
  • If 5/6 is divided by a certain fraction a/b, the result is 1/4. What is the fraction a/b?
    9·1 answer
  • What is the solution of the system? Use substitution
    11·1 answer
  • PLEASE help?!
    8·1 answer
  • How would you solve this?
    10·1 answer
  • Complete the first step in the solution.<br><br> 8=n÷3
    6·1 answer
  • Which net matches the solid figure shown below?
    11·2 answers
  • Seth needs to buy mulch to cover a circular garden. The garden has a radius of 5ft. Mulch costs $0.25 per square foot. How much
    12·1 answer
  • Which of the following is equal to the expression listed below? 25 + 10
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!