SHARE
TWEET

Untitled

a guest Feb 21st, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //September Cowley ID#260510197
  2. public class generateBenfordNumbers {
  3.     public static double [] generateBenfordNumbers(double initialAmount, double growthRate, int numberPeriods){
  4.    
  5.         double initial = initialAmount;
  6.         double rate = growthRate;
  7.         int numberOfPeriods = numberPeriods;
  8.        
  9.         double generateBenfordNumbers[] = new double [numberOfPeriods];
  10.    
  11.         generateBenfordNumbers[0] = initial;
  12.        
  13.         for (int periodNumber = 0; periodNumber < numberOfPeriods; periodNumber++){
  14.             generateBenfordNumbers[periodNumber] = (initial * (rate + 1));
  15.         }
  16.        
  17.         return generateBenfordNumbers;
  18. }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top