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
20 POINTS HELP FAST
victus00 [196]

Answer:

brainly.com/question/16576809

Step-by-step explanation:

3 0
2 years ago
Solving need help in don't get it
Orlov [11]
\sqrt{3x-5}-2=0
add 2 to both sides
\sqrt{3x-5}=2
square both sides
3x-5=4
add 5 to both sides
3x=9
divide 3
x=3

a nswer is B
4 0
3 years ago
An angle measures 12° less than three times it’s supplement. Find the measure of the angle
Butoxors [25]

Answer:

132 degrees.

Step-by-step explanation:

Let the supplement be x and the angle be y.

x + y = 180 degrees.

y = (3x - 12) degrees.

x + 3x - 12 = 180

4x = 192

x = 48 degrees

y = 132 degrees

Hope this helped!

6 0
2 years ago
Which group of numbers is in order from smallest to largest?
Ber [7]

Answer:

0.3, 45%, 13/25

Step-by-step explanation:

Is the smallest to largest

7 0
3 years ago
Read 2 more answers
Solve for x. x/3≤—6<br><br>1.x≤—2<br>2.x≤—18<br>3.x≥—2<br>4.x≥—18​
RSB [31]

Answer:

x \leqslant  - 18

Step-by-step explanation:

Multiply both sides by 3

x \leqslant  - 18

6 0
3 years ago
Other questions:
  • Share 72 sweets in the ratio 8:1
    14·2 answers
  • Whats the answer to this question and how did you do it?? thanks,,, (:
    9·2 answers
  • Find the number of elements in A 1 ∪ A 2 ∪ A 3 if there are 200 elements in A 1 , 1000 in A 2 , and 5, 000 in A 3 if (a) A 1 ⊆ A
    8·1 answer
  • When a number x is multiplied by 6, the result is 3/8 . What is the value of x?
    13·1 answer
  • If the tip of the arrow moves to (0,2), what is the center of rotation?
    8·1 answer
  • Need help on #25 please!! Show your work
    6·2 answers
  • Please answer anyone you can will appreciate it
    9·1 answer
  • I need help,Please it’s due today
    5·1 answer
  • 7 + -6 = what is the answer​
    14·2 answers
  • How have humans contributed to the growing population of Nomura’s jellyfish?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!