Results 1 to 4 of 4
  1. #1
    bankTechy is offline Member
    Join Date
    Sep 2013
    Posts
    7
    Rep Power
    0

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

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: A method to calculate monthly depreciation

    Post the exact error messages you get. Per coding conventions variables start with lower case letters.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    bankTechy is offline Member
    Join Date
    Sep 2013
    Posts
    7
    Rep Power
    0

    Default 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?

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,655
    Rep Power
    5

    Default 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.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Calculate Monthly Depreciation and Accumulation
    By bankTechy in forum New To Java
    Replies: 0
    Last Post: 10-29-2013, 02:21 PM
  2. Asset Monthly Depreciation
    By bankTechy in forum New To Java
    Replies: 2
    Last Post: 09-26-2013, 12:26 PM
  3. How do u calculate 2 numbers from the method
    By Shree123 in forum New To Java
    Replies: 1
    Last Post: 06-21-2013, 04:05 AM
  4. Replies: 5
    Last Post: 04-10-2012, 12:21 AM
  5. Depreciation
    By Fondor in forum Java Applets
    Replies: 1
    Last Post: 04-23-2010, 04:54 AM

Tags for this Thread

Posting Permissions

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