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
Find the cost of 10 pens at x pence each
Reika [66]

Answer:

D. x + 10 pence

Step-by-step explanation:

Since the pen costs 10 pence more than the ruler, we need to add 10 to x.

6 0
2 years ago
Read 2 more answers
Tyler delivers newspapers.He collected $10 from each customer.He has 5 customers on each street,and delivers to 4 different stre
strojnjashka [21]

Answer:

$200

Step-by-step explanation:

4 different streets with 5 customers on each means 4*5 customers or 20 customers. If he has 20 customers and he gets $10 from each one, thats 20*10. he collected $200

6 0
3 years ago
Read 2 more answers
How I can answer this question, NO LINKS, if you answer correctly I will give u brainliest!
Kazeer [188]

Answer:

It's the first one. We notice that for every package there are 36/3 = 12 pencils. Therefore for 4 packages there will be 4*12 = 48 pencils.

5 0
2 years ago
Last year the manager of a health care facility served 36,500 dinners. The manager estimates an increase of 5% in the number of
EastWind [94]

Answer:

38,325 dinners.

Step-by-step explanation:

We have been given that last year the manager of a health care facility served 36,500 dinners. The manager estimates an increase of 5% in the number of dinners to be served next year.

The estimated number of dinners next year would be 36,500 plus 5% of 36,500.

36,500+(\frac{5}{100}\times 36,500)

36,500+(0.05\times 36,500)

36,500+1,825

38,325

Therefore, 38,325 dinners will be served next year.

6 0
4 years ago
Don'te is sitting on the bus on the way home from school and is thinking about the fact that he has three homework assignments t
Darina [25.2K]

Answer:

B

Step-by-step explanation:

Find the common denominator of all the fractions, add the converted fractions of 0, 2, and 3, then simplify

6 0
3 years ago
Other questions:
  • Is negative 5/16 greater less than or equal to negative 8/25
    13·1 answer
  • Solve 7x-9=28+4(x-1)
    15·1 answer
  • What's <br> 9 + (28 − 2) ÷ 0.2
    12·1 answer
  • I NEED THIS PLEASE these are all my points!
    13·2 answers
  • Erin created a scale drawing for a garden that will be 10 ft by 5 ft. She plans to include a section in the garden for herbs, wh
    12·1 answer
  • The sum of two numbers is 48. If one third of one number is 5 greater than one sixth of another number, which of the following i
    5·1 answer
  • Convert into power notation -1/81​
    9·1 answer
  • HELP PLEASE ON A TIMER!!! TIME REMAINING: 29:00 Enter the x-coordinate of the solution to this system of equations.
    10·2 answers
  • Use the algebra tiles to model x – 3. Then complete the statements. The variable is represented by Subtracting three is represen
    5·1 answer
  • Please solve this paper​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!