Computer Science, asked by harsh19647047, 1 year ago

write a program in Java


wap to input principal rate and time then calculate the simple interest and compound interest

Answers

Answered by gurukulamdivya
10

Answer:

import java.util.Scanner;

public class Simple_Interest

{

   public static void main(String args[])  

   {

       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);

   }

}


harsh19647047: thanks yrrrr
gurukulamdivya: plz rate the answer
harsh19647047: sorry,but it is not given in question...
rakeshchennupati143: where is compound interest code
gurukulamdivya: CI = p*pow((1+r/100),t);
gurukulamdivya: jus include this line
harsh19647047: ok
harsh19647047: thank you soooouchhhh
harsh19647047: thank you so muchhhhh
Answered by Anonymous
0

Explanation:

JAVA

public class Celsius.

{

public static void main (String args[])

{ float Fahrenheit, Celsius;

Fahrenheit = 43;

Celsius = ((Fahrenheit-32)*5)/9;

System.out.println("Temperature in celsius is: "+Celsius);

}}

Similar questions