Answers for "java simple interest program"

1

Java program to find simple interest

// Java program to find simple interest
import java.util.Scanner;
public class SimpleInterestJavaProgram
{
   public static void main(String[] args)
   {
      float principal, rate, time;
      Scanner sc = new Scanner(System.in);
      System.out.print("Enter principal amount : ");
      principal = sc.nextFloat();
      System.out.print("Please enter rate annually : ");
      rate = sc.nextFloat();
      System.out.print("Please enter time(in years) : ");
      time = sc.nextFloat();
      float simpleInterest;
      simpleInterest = (principal * time * rate) / 100;
      System.out.println("The Simple Interest is : " + simpleInterest);
      sc.close();
   }
}
Posted by: Guest on December-10-2020

Code answers related to "java simple interest program"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language