Aoua's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
17 (0.02 per day)
Joined:
07-July 12
Profile Views:
475
Last Active:
User is offline Aug 05 2012 08:49 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   Aoua has not set their status

Posts I've Made

  1. In Topic: deposit program,BankAccount

    Posted 4 Aug 2012

    View Postpbl, on 04 August 2012 - 09:17 AM, said:

    Not sure of that formula at all

         public double calcMoneyAfterNYears(int n){  
             return this.amount * Math.pow(this.intrestRate / 100 + 1.0, n);  
         }  
    
    

    the interest should be compound year after year. I think it should rather look like

         public double calcMoneyAfterNYears(int n){ 
             double calculatedAmount = amount;
             for(int year = 0; year < n; ++year)
                 calculatedAmount += (calculatedAmount * interestRate); 
             return calculatedAmount;  
         }  
    
    

    dear sir thank you it vas very helpful tnx


    but here as part B said:

    take the same problem, but this time, you should write a java code, that calculate the number of years, after what the FinAmount becomes the double of IniAmount.

    now in my code its given me 1 year
     public int numberOfYearsTillDoubled(){
            int n = 0;
            double tempAmount = 0.0;
            while(true){
                tempAmount = this.calcMoneyAfterNYears(n);
                if(tempAmount >= this.amount * 2){
                    break;
                }
                n++;
            }
            return n;
        }
    

    i think the output should be like :

    Initial Amount : 100.0 Double Amount : 200.0 Interest Rate : 6.0
    
    Number of years required to double the initial amount : 12
    
    
    
     "
    


    any idea please!

    thanks again
  2. In Topic: square matrices

    Posted 2 Aug 2012

    any psedu code?!

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Comments

Aoua has no profile comments yet. Why not say hello?