星期日, 10月 23, 2005

project2_5


import javax.swing.JOptionPane;
public class project2_5
{
public static void main(String[] args)
{
String myPurchase=JOptionPane.showInputDialog("Enter the purchase price");
double purchaseprice = Integer.parseInt(myPurchase);
String mySalvage =JOptionPane.showInputDialog("Enter the salvage value");
double salvagevalue = Integer.parseInt(mySalvage);
String myYear = JOptionPane.showInputDialog("Enter the number of year");
double numberyear = Integer.parseInt(myYear);
double d;
d=(purchaseprice-salvagevalue)/numberyear;
System.out.println("The value of the yearly depreciation is "+d);
}
}

0 Comments:

張貼留言

<< Home