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
Use Inverse operations to solve the expression. Enter your answer in simplest form. y 1 =8 16​
vredina [299]
So we are trying to get the “y” alone, so to undo the division by -8, we will multiply both sides by -8, then simplify.

(-8) y/(-8) = (-8) 1/16

y = -8/16

and simplified:

y = -1/2
7 0
3 years ago
last year, total sales for your grocery store were $10,342 with returns of $214 and discounts of $599. the linear feet of shelvi
kompoz [17]

Answer:

The answer would be A. $16.6 per linear foot


8 0
3 years ago
Read 2 more answers
I NEED HELP PLEASE IM BEGGING YOU
horrorfan [7]

Answer:

$2

$1.26

Step-by-step explanation:

pls give brainliest if you can

8 0
3 years ago
Read 2 more answers
Can someone help me to solve these questions as step by step. I really need help because I really don’t understand why I’m getti
frutty [35]
<h3>Answer:</h3>

48 - Left

  • a. domain: all real numbers; range: all numbers greater than or equal to zero
  • b. x-intercept: x=0; y-intercept: y=0
  • c. decreasing for x < 0; increasing for x > 0; constant for x=0
  • d. even; the axis of symmetry is x=0

48 - Right

  • a. both the domain and range are all real numbers
  • b. x-intercept: x=0; y-intercept: y=0
  • c. increasing everywhere except x=0; constant for x=0
  • d. odd; symmetrical about the origin
<h3>Step-by-step explanation:</h3>

48 - Left

a. The function is defined for all values of x, so its domain is all real numbers. (The <em>domain</em> is the set of numbers for which the function is defined.) For any x (positive or negative), both the graph and the function f(x)=x² tell you that the value of f(x) cannot be less than zero. Hence the range is all numbers greater than or equal to zero (all non-negative numbers). (The <em>range</em> is the set of values the function can produce.)

b. The only point where the function crosses either axis is the point (0, 0). This is both the x- and y-intercept.

c. The function goes "downhill" left of x=0, so is decreasing there. The function goes "uphill" right of x=0, so is increasing there. At x=0, the function is horizontal, so is constant there.

d. The left branch is a mirror image of the right branch, reflected across the vertical line x=0. That line is the axis of symmetry. Every point on the left branch is as far to the left of that line as the corresponding point on the right branch is to the right of it. When x=0 is the line of symmetry, the function is an even function.

___

48 - Right

a. As with f(x) = x², the function f(x) = x³ is defined for all values of x. (This is true for <em>any polynomial function</em>.) Hence the domain is all real numbers.

Unlike f(x) = x², the function f(x) = x³ can produce any value of f(x), so the range is all real numbers.

b. As with f(x) = x², the only place where the graph crosses either axis is the point (0, 0). So, both the x- and y-intercept are 0.

c. The function goes "uphill" everywhere except at x=0, so is increasing for all x except x=0, where it is constant.

d. A polynomial of odd degree is an odd function, symmetrical about the origin. Every point above or to the right of the origin has a matching point below or to the left of the origin by the same distance.

7 0
3 years ago
What is the square footage of a 16in by 16in tile ​
sveta [45]

Answer:

the square footage is 256in

3 0
3 years ago
Other questions:
  • It takes 250 g of pasta and 240 ml of sauce to make one batch of spaghetti, and it takes 600g of pasta and 700ml of sauce to mak
    10·2 answers
  • Stella wants to buy colored pencils that cost $3.50. She has 1 dollar, 5 quarters, 4 dimes, and 7 pennies. Does she have enough
    11·1 answer
  • Which of the following best represents the average speed of a fast runner?
    8·2 answers
  • Negative square root of nine is it a rational or irrational number
    10·2 answers
  • Okay i need help! A novelist can write 1 7/8 pages in ¾ hour. At that rate, How much can she write in 1 hour?
    13·1 answer
  • Let u=  (-1,3) and w =(2,4) Find the resulting vector of 2u-4w  in component form..
    5·2 answers
  • What is the answer to my math problem
    15·1 answer
  • Can someone help me with all of this
    14·1 answer
  • Please help asap!!!!
    11·1 answer
  • (x+2)+10=44 please help​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!