x

Choose Country Code

x

Direction

x

Ask a Question

  • Ask a Question
  • Scan a Question
  • Post MCQ
  • Note: File extension must be of jpg, jpeg, png, bmp format and file size must not exceed 5 MB
x

Ask a Question

x

x
x
x
Hire a Tutor

Answers and Solutions

What's Your Question?
Answer

import java.util.Scanner;

 

class SimpleInterest {

public static void main(String arg[]) {

double princ, si;

float rate;

int time;

 

Scanner sc = new Scanner(System.in);

System.out.print("Enter Principal Amount: ");

princ = sc.nextDouble();

 

System.out.print("Enter Rate of Interest: ");

rate = sc.nextFloat();

 

System.out.print("Enter Time (in Years) : ");

time = sc.nextInt();

 

si = (princ * rate * time) / 100;

System.out.println("Interest Amount: " + si);

}

}

Answer

import java.util.Scanner;

public class sicalculator 

{

private static Scanner sc;

public static void main() 

{

double pamnt, roi, time, si;

sc = new Scanner(System.in);

System.out.println(" ***** SIMPLE INTEREST CALCULATOR ***** ");

System.out.print(" Please Enter the Principal Amount : ");

pamnt = sc.nextDouble();

System.out.print(" Please Enter the Rate Of Interest : ");

roi = sc.nextDouble();

System.out.print(" Please Enter the Time Period in Years only: ");

time = sc.nextDouble();

si = (pamnt * roi * time) / 100;

System.out.print("\nThe Simple Interest for............ \nThe Principal Amount Rs/- " + pamnt + " for " + time + " Years " + " at a Rate of " + roi + " is Rs/- " + si);

}

}

Answer

import java.util.Scanner;

 

public class SimpleInterest

{

 

public static void main(String[] args) {

// TODO Auto-generated method stub

float p, r, t;

        Scanner s = new Scanner(System.in);

        System.out.print("Enter the Principal : ");

        p = s.nextFloat();

        System.out.print("Enter the Rate of interest : ");

        r = s.nextFloat();

        System.out.print("Enter the Time period : ");

        t = s.nextFloat();

        float si;

        si = (r * t * p) / 100;

        System.out.print("The Simple Interest is : " + si);

}

 

}

OUTPUT:

Enter the Principal : 1000 Enter the Rate of interest : 5 Enter the Time period : 2 The Simple Interest is : 100.0

Answer

import java.util.*; public class SimpleInterest{

     public static void main(String []args){        int principal;        int rate;        int time;        double interest;        Scanner sc = new Scanner(System.in);        System.out.println("Enter the principal amount in Rs");        principal = sc.nextInt();        System.out.println("Enter the % rate of interest");        rate = sc.nextInt();        System.out.println("Enter the duration in years");        time = sc.nextInt();        interest = (principal*rate*time)/100;        System.out.println("Interest for "+time+" years is "+interest);      } }

Post Answer and Earn Credit Points

Get 5 credit points for each correct answer. The best one gets 25 in all.

Post Answer