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

 

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

Write a program that produces the test data shown. The basic idea is that you are looking to see if the prime number 'prime' is ever a remainder of num/divisor for any divisor from 2 to num/2 inclusive. As preconditions you may assume that 'prime' is a prime number and that 'num'*2>='prime'. Look at the test data!


test2022_12_08_HL_primeRemainders(51728, 4391) → "4391 IS a remainder of 51728 when divided by 15779."
test2022_12_08_HL_primeRemainders(7528, 4391) → "4391 is NOT a remainder of 7528."
test2022_12_08_HL_primeRemainders(45, 5) → "5 IS a remainder of 45 when divided by 8."

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

public String test2022_12_08_HL_primeRemainders(int num, int prime) { }

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: 290

Copyright Nick Parlante 2017 - privacy