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
The wheels on Noah's bike have a circumference of about 5 feet. How far does the bike travel as the wheels makes 15 complete rot
grin007 [14]

Answer:

75 feet

Step-by-step explanation:

If the circumference of the wheels is 5 feet, every full rotation the bike will travel 5 feet. Therefore, after 15 full rotations the bike will travel 15 * 5 = 75 feet.

8 0
3 years ago
Read 2 more answers
What the solution for CED
ElenaW [278]
Answer: 58 degrees
Explanation: 180-122=58
7 0
2 years ago
Read 2 more answers
What is the quotient matches 22/33 divided by 6/9
olchik [2.2K]

Hey there! I'm happy to help!

When you divide fractions, you are technically multiplying by the reciprocal, which is the numerator and denominator flipped. This means that 22/33 divided by 6/9 is equal to 22/33 multiplied by 9/6.

If we multiply these together, we get an answer of 1.

I hope that this helps! Have a wonderful day!

8 0
3 years ago
Count the possible combinations of r letters chosen from the given list P.Q,R,S,T,U; r = 2
Tasya [4]

Answer:

<h2>There are 30 possible combinations of picking two letters.</h2>

Step-by-step explanation:

The combinations are defined as

C^{r}_{n}=\frac{n!}{(n-r)!}

Where n is the total number of elements and r is the number of letter we are gonna picke, which is two. Using this information, we have

C^{2}_{6}=\frac{6!}{(6-2)!}=\frac{6!}{4!}=\frac{6 \times 5 \times 4!}{4!}=30

Therefore, there are 30 possible combinations of picking two letters.

4 0
3 years ago
Solve for y on problem #2
Anestetic [448]

9514 1404 393

Answer:

  y = (x +7)/3

Step-by-step explanation:

Multiply the given equation by y/3:

  \dfrac{x+7}{y}\cdot\dfrac{y}{3}=3\cdot\dfrac{y}{3}\\\\\boxed{y=\dfrac{x+7}{3}}

5 0
3 years ago
Other questions:
  • The number of miles driven is proportional to the gallons of gasoline used. The graph shows this relationship. What is the unit
    6·1 answer
  • 1. The expression 11x2 - 12x - 10 has ___ terms and a constant of ___.
    5·2 answers
  • A drawer contains 4 blue socks, 8 black socks, and 10 white socks. If one sock is
    5·1 answer
  • Witch number produces a rational number when multipled by 0.25
    10·1 answer
  • What is the value of y !!????
    15·1 answer
  • What are potential roots of p(x) = x4 − 9x2 − 4x + 12
    12·2 answers
  • 3y-x=3 and x is four times the value of y what is the value of x-y?
    15·1 answer
  • Pls help will give brainlest answer
    12·1 answer
  • Ms. Jackson emptied 16 boxes of crayons into a classroom crayon bucket in each box 2/9 The crayons were green how many crayon bo
    8·2 answers
  • Bill's boss paid $20.05 for doughnuts for the office staff. The total included 1.30 cents for tax and $1.25 per doughnut. How ma
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!