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
What is the keyboard command that allows you to copy text
alex41 [277]

Control + C For Desktops and Windows

Control +V to paste

Command+ C For Macbooks

Command+ V to paste

Hope this helps

-Dante


5 0
3 years ago
Read 2 more answers
The frame work for storing records in database is a
andreev551 [17]
The frame work for storing records in database is a report. (b)
3 0
3 years ago
Given a sorted list of integers, output the middle integer. Assume the number of integers is always odd. Ex: If the input is: 2
ser-zykov [4K]

Answer:

....................................

Explanation:

8 0
3 years ago
If you enter a command and want to terminate its execution before it is finished, you can press ____ to do so.
sertanlavr [38]
If you mean on the phone you can press the home button. if you mean on the computer you could press esc
5 0
3 years ago
Read 2 more answers
Cylinders containing _________ or acetylene shall not be placed in a confined space. A. Oxygen B. Sand C. WaterCylinders contain
Helen [10]

/////////////////////////////oxygen///////////////////////////////////////////

6 0
4 years ago
Other questions:
  • The _____ of each phrase in a melody can be drawn with a curved line that follows the direction of the note progression.
    15·1 answer
  • Case-Based Critical Thinking Questions​Case 1: Tony’s Pizza & Pasta​Tony’s Pizza & Pasta restaurant uses an application
    9·1 answer
  • Files containing ____ are available from a variety of sources.
    10·1 answer
  • Does anyone know what edmodo is? If you do please tell me what it is and what you do on edmodo.
    15·1 answer
  • Which of the following are TRUE? A function can call another function. As long as the function is defined anywhere in your progr
    14·1 answer
  • To all paladins players out there!!!!!
    14·1 answer
  • Cine stie repede va rog mult si repede
    9·1 answer
  • What is another word for: a location in memory that contains a value?
    7·2 answers
  • State three reasons why users attach speakers to their computer​
    8·1 answer
  • How many total bits are required for a direct-mapped cache with 128 blocks and a block size of 8 bytes, assuming a 4GB main memo
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!