Fixed error in code primesFoundSoFar from 1 to 2
updated the class variables to understandable, camel-case names
changed variable names in calculateOddPrimes() - made variable names
more clear and camel-case
updated variable names in printPrimes() method - changed to camel case
updated rowOffset variable in printPrimes() class
updated variable names in calculateOddPrimes()
added curly braces to calculateOddPrimes() and changed ord = ord + 1 to
ord++
updated printPrimes() method - added curly braces and updated syntax
Gave more clear variable names:
replaced mult with oddNonPrimes
replaced n with tempIndex
edited spacing
updated WW to variable, left a comment explaining logic
updated oddNonPrimes to multOfPrimes, added comment with explanation
updated tempIndex = tempIndex + 1 to tempIndex++ for consistency
commented calculateOddPrimes() method with a detailed description of the
method
commented calculatedOddPrimes() method and made code more percise:
listOfPrimes[tempIndex] + listOfPrimes[tempIndex] =
2*listOfPrimes[tempIndex]
created formatPrint method by moving code from printPrimes method to
simplify readability
Created the findComposites method. This method is called in the
calculateOddPrimes method. Description is in comments. Moved for
readability.
updated spacing
updated variable names in CalculateOddPrimes
ord --> indexOfPrime
j --> cur
added a class header