0

i want to write a function which calculates the Monthly depreciation and accumulation of an asset but i am having difficulties writing it to calculate and insert it into my datebase.I will appreciate the help

private double getAccumulation(){
       double Accumulation = 0;
       double Monthly_Depreciation;
       int Estimated_Useful_Life = Integer.parseInt(eul.getText());
       double Cost_Of_Acquisition = Integer.parseInt(txt_coa.getText());
       double Estimated_Residual_Value = Integer.parseInt(txt_erv.getText());


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


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

       return Accumulation;
   }
2
Contributors
1
Reply
15
Views
3 Years
Discussion Span
Last Post by london-G
0

I don't see any see any database in your code. What I will suggest is to print the resuls using system.out.println and check if the value appears.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.