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
inn [45]
3 years ago
13

Create the logic for a program that calculates and displays the amount of money you would have if you invested $5000 at 2 percen

t interest for one year. Create a separate method to do the calculation and return the result to be displayed.

Computers and Technology
2 answers:
avanturin [10]3 years ago
8 0

Answer:

# main function is defined

# the calculateAmount is called here

def main():

   print("The new amount is: ", calculateAmount(), sep="")

   

# calculateAmount function that calculate the interest

def calculateAmount():

   # the value of principal is p

   p = 5000

   # the value of rate is r

   r= 2

   # the time is t

   t = 1

   # the formula for finding interest

   interest = (p * r * t) / 100

   # the new amount is calculated

   amount = p + interest

   # the amount is returned

   return amount

# a call that make main function begin execution

if __name__ == "__main__":

   main()

Explanation:

The program is written in Python and it is well commented. A screenshot is attached showing program output

Wewaii [24]3 years ago
4 0

Answer:

public class num7 {

   /* Interest = (Principal *Rate*Time)/100

       Total amount you will have = principal (5000)+Interest

    */

   public static void main(String[] args) {

       double prinAmount = 5000;

       System.out.println("The total amount is "+(calInterest(prinAmount)));

   }

   static double calInterest(double principal){

       int time =1;

       double rate = 2.0;

       double interest = (principal*rate*time)/100;

       double principalPlusInterest = principal+interest;

       return principalPlusInterest;

   }

}

Explanation:

The Logic for this program is:

Interest = (Principal *Rate*Time)/100

Total amount you will have = principal (5000)+Interest

The method calInterest()  accepts a double parameter (principal Amount) and uses the logic above to calculate and return the total amount.

The Main Method calls calInterest() and outputs the value calculated in this case since it is hardcoded 5100

You might be interested in
Which commas is used to combine two or more cells together into one cell
AURORKA [14]
The command is Merge & Center
This command could be easily found in the toolbar of your excel.
If you execute this command in two different cells, those cells will be merged into one larger cell and the content in that cells will be placed exactly in the middle of the combined cell (measures according to combined cells' length)
5 0
3 years ago
Indentation is useful to make the document easier to read. To increase the indentation of the paragraph, you press the increase
jeka94

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

The correct answer is Home.

Indentation is useful to make the document easier to read. To increase the indentation of the paragraph, you press the increase indentation in the   <u>Home</u> tab.

you can increase/ decrease indentation in Home tab under the Paragraph groups of command.

Othe options are not correct because:

View tab has settings related to how the document looks like. Insert tab has settings related to the insertion of image, shape, pages, tables, illustration, and links, etc into a document. The review tab allows you to review the document with different available settings.

4 0
3 years ago
It is possible to collaborate on a presentation with a group of people using the Internet.
DerKrebs [107]

Answer:

True

Explanation:

4 0
3 years ago
Most of us have been using elements of Web 2.0 without even realizing it.<br> True<br> False
aleksandrvk [35]

Answer: True?

Explanation:

I’m pretty sure I’m new to that stuff

5 0
3 years ago
1. The Percentage of T9 and T10 also have the wrong number format. Change them to the Correct number format(to match the rest of
pentagon [3]

Answer:

60%

Explanation:

After changing the number format of the percentages of T9 and T10, the value that now shows in T10 due to the change from the wrong format to the Right format is 60%

This is because when a value is entered into a column in a wrong format the value would be different from other values entered rightly but when the format is changed to the right format, the correct value would show up.

5 0
3 years ago
Other questions:
  • WILL MARK BRAILIEST IF ANSWERED FAST!!!
    8·1 answer
  • file Assume that a prototype of the part above was built from several cubes. The total volume of the part is 0.54675 in.3. What
    6·1 answer
  • which virtue you need to secure information by limiting computer access to authorized personnel only?
    10·1 answer
  • If you want to adjust the width of a column manually, move your mouse over the _______ column boundary and click and drag until
    9·1 answer
  • 9. h=
    6·1 answer
  • The costs incurred when a firm buys on the marketplace what it cannot make itself are referred to as
    6·1 answer
  • python. create a program that asks the user to input their first name and their favorite number. Then the program should output
    12·1 answer
  • Drag the tiles to the correct boxes to complete the pairs.
    6·1 answer
  • The int function can convert floating-point values to integers, and it performs rounding up/down as needed.
    11·1 answer
  • You are given a list of N integers . find the largest sum of a continuous sequence from the given list
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!