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
witch option in a presentation program contains the formatting and placeholders for all the items that appear on a slide?
Nikitich [7]

SWITCH BETWEEN OPEN PRESENTATIONS. ..... Presentation software is a program designed for the production and display of .... image file format and version number. 1. .... Option. To Do This. Normal. Contains three panes: the outline pane, the slide pane, and the notes pane. .... appear on every slide in a presentation.

7 0
3 years ago
Read 2 more answers
Can anybody tell me how to screenshot on a PC with no "print screen" button?
Liono4ka [1.6K]

There is a extension from google chrome webstore that allows to take a screnshot

8 0
3 years ago
The two types of one-time-password tokens are ______ and ______.
Nutka1998 [239]

Answer:

event based and time based

Explanation:

OTP tokens come in two types: event-based (HOTP) and time-based (TOTP). Event-based OTP tokens generate new codes at the press of the button and the code is valid until it is used by the application. Time-based OTP tokens generate codes that are valid only for a certain amount of time (eg, 30 or 60 seconds), after which a new code must be generated

5 0
4 years ago
Read 2 more answers
A man inside water, the pressure which acts on him is
suter [353]

Answer:

C. Liquid and atmospheric pressure

Explanation:

https://courses.lumenlearning.com/physics/chapter/11-4-variation-of-pressure-with-depth-in-a-fluid/

6 0
2 years ago
After installing the processor, if the system begins the boot process and suddenly turns off before completing the boot, the pro
NikAS [45]

Answer:

A. True

Explanation:

Be sure your processor is receiving sufficient cooling by verifying if there is a heatsink on it. If there is, make sure that it's inserted fully into cpu_fan port on the motherboard. If the boot process still turns off, you may have a defective processor or replace the motherboard.

8 0
3 years ago
Other questions:
  • Desktop, laptop, and tablet computers, and mobile devices are classified as _______.
    7·1 answer
  • Never mind I got it
    8·2 answers
  • Which of these expressions evaluates to 4.0?
    12·2 answers
  • Why do contour lines never cross?
    5·1 answer
  • Blank is a type of drag and drop code to help beginner
    14·1 answer
  • A type of VPN connection, where a single computer logs into a remote network and becomes, for all intents and purposes, a member
    13·1 answer
  • What is the difference between web and internet ?
    10·1 answer
  • Using existing algorithms as building blocks for new algorithms has all the following benefits EXCEPT
    12·1 answer
  • Heeeeeeeelp :)<br> thx<br> jfdyiusjmkdsuiho;dmcvrvho;j
    5·2 answers
  • What are the different alignment options available in Microsoft​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!