Thread: A method to calculate monthly depreciation

1. Member Join Date
Sep 2013
Posts
7
Rep Power
0 A method to calculate monthly depreciation

I have written this method to calculate the monthly depreciation based the entry of the Cost_Of_Acquisition,Estimated_Residual_Value,Estim ated_Useful_Life .
but it outputs soo many errors and i can't seem to understand where the problem is. Any help or direction will be appreciated Java Code:
private void getAccumulation(){
double Monthly_Depreciation;
double Cost_Of_Acquisition = Integer.parseInt(txt_coa.getText());
double Estimated_Residual_Value = Integer.parseInt(txt_erv.getText());
int Estimated_Useful_Life = Integer.parseInt(eul.getText());

try{
Monthly_Depreciation = (Cost_Of_Acquisition - Estimated_Residual_Value)/Estimated_Useful_Life;

System.out.print(Monthly_Depreciation);

}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}

}  Reply With Quote

2. Re: A method to calculate monthly depreciation

Post the exact error messages you get. Per coding conventions variables start with lower case letters.  Reply With Quote

3. Member Join Date
Sep 2013
Posts
7
Rep Power
0 Re: A method to calculate monthly depreciation

the error it gives is related to this part of the code
double Monthly_Depreciation;
double Cost_Of_Acquisition = Integer.parseInt(txt_coa.getText());
double Estimated_Residual_Value = Integer.parseInt(txt_erv.getText());
int Estimated_Useful_Life = Integer.parseInt(eul.getText());

the whole idea is let the user enter the values manually on a form the when he or she clicks a button it does the calculation and gives the user the output.
i hope u get what am trying to do?  Reply With Quote

4. Just a guy Join Date
Jun 2013
Location
Netherlands
Posts
5,114
Rep Power
12 Re: A method to calculate monthly depreciation

So when someone asks you "Post the exact error messages you get", you then go ahead and do exactly not that.  Reply With Quote

Tags for this Thread

java  Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•