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
xenn [34]
4 years ago
8

An online bank wants you to create a program that shows prospective customers how their deposits will grow. Your program should

read the initial balance and the annual interest rate. Interest is compounded monthly. Print out the balances after the first three months. Here is a sample run:
Initial balance: 1000

Annual interest rate in percent: 6.0

After first month: 1005.00

After second month: 1010.03

After third month: 1015.08
Computers and Technology
2 answers:
EleoNora [17]4 years ago
8 0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

   

 Scanner input = new Scanner(System.in);

 System.out.print("Enter the initial balance: ");

 double initialBalance = input.nextDouble();

 System.out.print("Enter the annual interest rate: ");

 

 double annualInterestRate = input.nextDouble();

 double monthlyInterest = (annualInterestRate / 100) / 12;

       double currentBalance = initialBalance + (initialBalance * monthlyInterest);

 

 for(int month=1; month<=3; month++){

     System.out.printf("Your balance after " + month + ". month: %.2f \n", ((initialBalance + (initialBalance * monthlyInterest)* month)));

 }

}

}

Explanation:

* The code is written in Java

- Ask user to enter initial balance and annual interest rate

- Calculate the monthly interest

- Calculate the current balance

- Print the value of the balance after first three months using for loop

lana66690 [7]4 years ago
5 0

Answer:

  1. init_balance = float(input("Initial balance: "))
  2. interest = float(input("Annual interest rate in percent: "))
  3. montly_interest = (interest / 100) / 12
  4. current_amount = init_balance + init_balance * montly_interest
  5. print("After first month: %.2f " % current_amount)
  6. current_amount = current_amount + current_amount * montly_interest  
  7. print("After second month: %.2f " % current_amount)
  8. current_amount = current_amount + current_amount * montly_interest
  9. print("After third month: %.2f " % current_amount)

Explanation:

The solution code is written in Python.

Firstly, prompt user to input initial balance and annual interest rate using input function (Line 1 - 2).

Next, divide the annual interest by 100 and then by 12 to get the monthly interest rate (Line 4).

Apply the formula to calculate the current amount after adding the monthly interest (Line 5) and display the current month after first month (Line 6).

Repeat the same steps of Line 5 - 6 to calculate amount after two and three months and display print them to console. (Line 8 - 12).

You might be interested in
Which system is a type of artificial intelligence that uses a database, containing facts and rules, to provide assistance to use
Sholpan [36]
The appropriate response is an Expert system (ES). PC program that gives guidance to leaders who might somehow or another depend on human specialists. It's a sort of computerized reasoning that uses a database to give help to clients.
6 0
3 years ago
The question is provided in the image below.
Vladimir [108]

Answer: b

Explanation:

3 0
2 years ago
What formatting has been applied to this title?
kvasek [131]

What title? or No formating

4 0
3 years ago
Is playing hockey output force or input force?
LUCKY_DIMON [66]

Answer:

Input

Explanation:

got it right on a edunuity test

7 0
3 years ago
Read 2 more answers
What are the pros and cons of using the internet in a medical office setting
kherson [118]
The Pros of using the internet in a medical office setting are mostly that an unlimited amount of knowledge can be gained with the click of a button, and communications between doctors are practically instantaneous. The cons are mostly that these systems can be hacked into, which can leak patient information, and that sometime the Internet can "go down", which can reduce productivity. 
4 0
3 years ago
Other questions:
  • A company's computers monitor assembly lines and equipment using ________ communications.
    6·1 answer
  • What has prompted schools to add Internet activities in their academic integrity policies?
    6·2 answers
  • When a defendant pleads guilty to one offense just to have another offense dropped, this is what type of plea bargain
    14·2 answers
  • List three uses of the INTERNET
    9·2 answers
  • Imagine that you are preparing a series of bitmap graphics for a Website. To decrease the download time for each graphic, you ca
    5·1 answer
  • The data set monarch from Computer-Active Data Analysis by Lunn andMcNeil (1991) contains the years lived after inauguration,ele
    9·1 answer
  • import java.util.Scanner; public class TeenagerDetector { public static void main (String [] args) { Scanner scnr = new Scanner(
    6·2 answers
  • Which scenario could be represented by the given graph?
    14·1 answer
  • Can anyone give me Nitro type gold please? My NT account is trapkaybee061307
    9·2 answers
  • Describe the role of a distributed file system in a job execution environment such as MapReduce in a large-scale cloud system. g
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!