Sunday, October 23, 2005

Project 2.05

package aaa;
import javax.swing.JOptionPane;
public class aaa
{
public static void main(String[] args)
{
String purchaseString = JOptionPane.showInputDialog(
"Enter purchase of price:");
double p = Double.parseDouble(purchaseString);
String salvageString = JOptionPane.showInputDialog(
"Enter salvage value:");//copy from icesun
double s = Double.parseDouble(salvageString);
String yearServiceString = JOptionPane.showInputDialog(
"Enter expected number of years of service:");
double y = Double.parseDouble(yearServiceString);
double sum = (p-s)/y;//copy from icesun
JOptionPane.showMessageDialog(null,"The yearly depreciation ="+sum);

}
}

0 Comments:

Post a Comment

<< Home