{{#items}}

{{text}}

{{/items}} {{ctaText}}

{{#items}} {{/items}}

showing results for - "java program to calculate compound interest"

Valentina

25 May 2020

```
1// Java program to find simple interest
2import java.util.Scanner;
3public class SimpleInterestJavaProgram
4{
5 public static void main(String[] args)
6 {
7 float principal, rate, time;
8 Scanner sc = new Scanner(System.in);
9 System.out.print("Enter principal amount : ");
10 principal = sc.nextFloat();
11 System.out.print("Please enter rate annually : ");
12 rate = sc.nextFloat();
13 System.out.print("Please enter time(in years) : ");
14 time = sc.nextFloat();
15 float simpleInterest;
16 simpleInterest = (principal * time * rate) / 100;
17 System.out.println("The Simple Interest is : " + simpleInterest);
18 sc.close();
19 }
20}
```

Gabriele

06 Apr 2020

```
1// Java program to calculate compound interest
2public class CompoundInterestDemo
3{
4 public void calculateCompound(int p, int t, double r, int n)
5 {
6 double number = p * Math.pow(1 + (r / n), n * t);
7 double interest = number - p;
8 System.out.println("Compound interest after " + t + " years: " + interest);
9 System.out.println("Money after " + t + " years: " + number);
10 }
11 public static void main(String[] args)
12 {
13 CompoundInterestDemo obj = new CompoundInterestDemo();
14 obj.calculateCompound(200000, 6, .06, 12);
15 }
16}
```

similar questions

calculating the percentile in javaa recursive function that calculates the greatest common divisor from user 27s input in javaequality primitives javasimple calculator program in javahow do you rate yourself in javajava program to calculate average of 3 numbershow does minus works in javahow to compare 3 numbers in javacall by value and call y refrence in javacombinations in javacalculator program in javacomprobacontrasinais javajava find the greatest common divisor of two positive integers the integers can be large 2c so you need to find a clever solution how to calculate exponential in javajava integer comparetosimple interest in javahow to do quadratic formula in javaqueries leading to this page

how do you write compound interest formula in java 3fsimple interest java programjava program to calculate rate in compound interesthow to find simple and compound interest in javajava program to calculate interestcompound interest formula javaformula of compound interest in javacompound interest calculator javacalculate compound interest javasimple interest formula java programwrite a program to calculate the simple interest of a given amount java java program for calculating simple interestcompound interest calculator with javacompound interest formula in javacompound interest using javaprogram to calculate simple interest in javawrite a java program to calculate the simple interestprogram to calculate simple interest javacompound interest method javawrite a java program to calculate simple interestjava program to calculate simple interestjava program for compound interestwrite a program to calculate the simple interest in javacompound interest in javajava program to calculate simple interest and compound interestcompound interest javacompound interest java programjava program to calculate compound interestallintitle 3ajava program to calculate compound interestcompound interest java codejava program simple interestcalculate the simple interest in javajava program to find simple interestsimple interest program in javajava simple interest programcalculate compound interest in javahow to find compound interest in javawrite a program to find the simple interest in javajava program to calculate compound interest your answer for

you will get a confirmation link on this - you will have to click that for successful submission of your answer. we require this to keep the website free of spam, bots and unhelpful content

please ensure to add code which is syntactically corrent and executes properly

ask question on maxinterview

you will get a confirmation link on this - you will have to click that for successful submission of your question. we require this to keep the website free of spam, bots and unhelpful content

please be clear, to the point and respectful