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
Helppp, determine the indicated lengths
Nady [450]

Answer:

phuk u uagsgshwgwgdgwgwyegwgwgwhehehehe

8 0
2 years ago
Select the correct answer from each drop-down menu.
Lilit [14]

Answer:

The probability of the spinner landing on an even number or a multiple of 3 is 0.6667 .

The probability of the spinner landing on an odd number or a number between 4 and 15 (both numbers excluded) is 0.7778 .

Step-by-step explanation:

Be the events

A = even number

B = Multiple of 3

C = Odd Number

D = Number between 4 and 15, both numbers excluded

The sets are as follows:

A = {2,4,6,8,10,12,14,16,18}

B = {3,6,9,12,15,18}

C = {1,3,5,7,9,11,13,15,17}

D = {5,6,7,8,9,10,11,12,13,14}

To calculate the probability that the roulette lands in an even number or in a multiple of 3, we make the union of A and B:

A U B = {2,3,4,6,8,9,10,12,14,15,16,18} = 12 numbers of 18

P (A U B) = 12/18 = 2/3 = 0.6667

To calculate the probability that roulette lands on an odd number or a number between 4 and 15 (both numbers excluded), we make the union of C and D:

C U D = {1,3,5,6,7,8,9,10,11,12,13,14,15,17} = 14 numbers of 18

P (C U D) = 14/18 = 7/9 = 0.7778

The first answer is 0.6667

The second answer is 0.7778

Hope this helps!

7 0
3 years ago
Colin wants to set up an aquarium.. He already has a tank, but needs to purchase fish, filters, and plants. If the cost of the f
ahrayia [7]

Answer:

340.65

Step-by-step explanation: Add 84.79+44.75+18.66=148.2

148.2-$488.85= 340.65

7 0
3 years ago
Read 2 more answers
Explain the difference between complementary and supplementary angles.
jek_recluse [69]

Answer:

Step-by-step explanation: Two angles are called complementary when their measures add to 90 degrees. Two angles are called supplementary when their measures add up to 180 degrees. One way to avoid mixing up these definitions is to note that s comes after c in the alphabet, and 180 is greater than 90.

Supplementary angles are two angles whose measures add up to 180° . The two angles of a linear pair , like ∠1 and ∠2 in the figure below, are always supplementary. But, two angles need not be adjacent to be supplementary. In the next figure, ∠3 and ∠4 are supplementary, because their measures add to 180° .

3 0
3 years ago
Greatest integer of x < -3
Irina18 [472]

Answer:

-4

Step-by-step explanation:

Here, we want to get the greatest integer less than -3

The integer less than -3 that is the greatest is -4

It is the internet directly after it to the left of the number line

8 0
3 years ago
Other questions:
  • A bucket holds 84.5 ounces of water. How much is this in liters?
    11·2 answers
  • Paul took 6 blocks and arranged them in a pile. If each block is 4 inches in height. How many feet high is the pile that Paul ma
    12·2 answers
  • Write the equation in slope-intercept form of the line passing through (2,7) and (-5,2).
    9·2 answers
  • What is the area of the sector help plsssss
    15·1 answer
  • Find the length of a track that is a rectangle and two semi circles . Rectangle is 87m long and 65 m wide
    6·1 answer
  • From a point P, a boy observe that the angle of elevation of the top of a pole is 45, if the height of the
    12·1 answer
  • PLEASEE HELP ASAP!!!!
    8·2 answers
  • Gsgs helpppp.plssssss​
    12·2 answers
  • A cylinder has volume 45 pie and radius 3. What is its height?
    10·1 answer
  • if planet 1 is 32.7 million miles farther from the sun than planet 2, then planet 3 is 26.5 million miles farther from the sun t
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!