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;
}