id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > finalExam2014digitSumPrimes
prev  |  next  |  chance

Write a method that accepts any prime integer as an input parameter. Return the sum of the digits of that prime number. You must solve this problem using recursion in a non-trivial way and without using any string commands. You may assume the input parameter is prime and do not need to do any verification of this fact.


finalExam2014digitSumPrimes(472882049) → 44
finalExam2014digitSumPrimes(393342743) → 38
finalExam2014digitSumPrimes(65537) → 26

...Save, Compile, Run (ctrl-enter)

public int finalExam2014digitSumPrimes(int num) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 450

Copyright Nick Parlante 2017 - privacy