about | help | code help+videos | done | prefs |
Write a method that returns the sum of all the prime factors of the input parameter. Prime numbers are: 2, 3, 5, 7, 11, etc. These numbers only have whole number factors of themselves and 1. For example, 5 only has factors of 1 and 5, so 5 is prime. The input parameter will be an integer that is greater than or equal to 2. This is not as difficult as it may seem. Think first! Use paper and pencil to model with some of the test data! sept7_2018_SLHL_sumFactors(1542451) → 1542451 sept7_2018_SLHL_sumFactors(2) → 2 sept7_2018_SLHL_sumFactors(18) → 8 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290
Copyright Nick Parlante 2017 - privacy