Program to calculate Simple Intrest

import java.awt.*;
import javax.swing.JOptionPane;
import java.applet.Applet;
/*
  
  
*/
public class Interest extends Applet
{
String rate;
public void start()
{
String s=JOptionPane.showInputDialog("enter principal amount");
int p=Integer.parseInt(s);
s=JOptionPane.showInputDialog("enter rate");
int r=Integer.parseInt(s);
s=JOptionPane.showInputDialog("enter time");
int t=Integer.parseInt(s);
rate=getParameter("rate");
if(rate.equals("monthly"))
{
double amount=(p*t*r)/(100*12);
JOptionPane.showMessageDialog(null,"simple interest="+amount,"simple interst",JOptionPane.INFORMATION_MESSAGE);
}
else
{
double amount=(p*t*r)/(100);
JOptionPane.showMessageDialog(null,"simple interest="+amount,"simple interst",JOptionPane.INFORMATION_MESSAGE);
}
}
}


All Rights Reserved The Origin for Screamers | Design by SCREAMERS
Computers
Top Blogs