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
Are the following proportional? Explain or show<br> your reasoning<br> 3/5 and 18/25
kykrilka [37]

Answer:

No, they are not proportional. 3/5 with equal out to 15/25 by using the method of Least Common Denominator!

Step-by-step explanation:

Hope this helps :)

7 0
3 years ago
Calculator
adelina 88 [10]

(\stackrel{x_1}{1}~,~\stackrel{y_1}{2})\qquad (\stackrel{x_2}{5}~,~\stackrel{y_2}{4}) ~\hfill \stackrel{slope}{m}\implies \cfrac{\stackrel{rise} {\stackrel{y_2}{4}-\stackrel{y1}{2}}}{\underset{run} {\underset{x_2}{5}-\underset{x_1}{1}}}\implies \cfrac{2}{4}\implies \cfrac{1}{2}

8 0
2 years ago
What is the solution to this equation x - 13 =-4
Lelu [443]

Answer:

X=9

Step-by-step explanation:

x=-4+13=9

3 0
3 years ago
Read 2 more answers
Y= -0.25x + 4.7<br> Y=4.9x - 1.64
Andreas93 [3]

Answer:

The answer would be (1.23, 4.39)

Step-by-step explanation:

Because they are both equal to y, we can set the equations equal to each other and then solve.

4.9x - 1.64 = -0.25x + 4.7

5.15x - 1.64 = 4.7

5.15x = 6.34

x = 1.23

Now that we have the value for x, we can plug into either equation and find y.

y = -0.25x + 4.7

y = -0.25(1.23) + 4.7

y = -.31 + 4.7

y = 4.39

3 0
4 years ago
15. A 3 kg ball is thrown upward with a velocity of 10 m/s.
11Alexandr11 [23.1K]
The answer is A- between 8 m& 12m
5 0
3 years ago
Other questions:
  • What is the true solution to the logarithmic equation?<br>log2 [log2(sqrt4x)]=1​
    12·2 answers
  • A bowling alley charges 2.00 per game and will rent a pair of shoes for 1.00 for any number of games. The bowling alley has an e
    13·1 answer
  • Carl works at a garment factory and sews buttons on shirts. For each shirt he completes that passes inspection, he earns $2. How
    12·1 answer
  • Julie planted a rectangular garden that is 20 feet long. She placed 56 feet of fencing around her garden. Draw and label a sketc
    11·1 answer
  • A circle has a radius of 6.87 ft. What is the circumference of this circle? Use 3.14 for pi. Round your final answer to the near
    9·2 answers
  • Need help...........
    5·2 answers
  • Angelia's Store received 18 boxes of chocolates. Each box contained 56 pieces of chocolate. How many pieces of chocolate did the
    10·1 answer
  • What is the volume of the can?
    15·2 answers
  • Write the equation of the line passing through the points (-4,7) and (-7,4)​
    15·2 answers
  • Answer for brainliest
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!