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

 

tmhscs@gmail.com competition > HPCW2020_05_HordaksBoss
prev  |  next  |  chance

Hordak's Boss
Problem 05
Worth 2 points

Julia is working on an encryption algorithm which uses the factors of prime
numbers for the basis of its one-way hashing. The first step she needs to
solve for her algorithm is determining if her random number generator (RNG)
is sending prime numbers or not. So she needs to code a prime number tester.

Read in a single integer from the "RNG", then test the number to determine
if it is Prime or not. A Prime number is only evenly divisible by the number
1, and itself.

Print # is PRIME if the number being tested is Prime. Else, print # is
NOT Prime Where # is the number being tested.


HPCW2020_05_HordaksBoss(1) → "1 is NOT PRIME"
HPCW2020_05_HordaksBoss(2) → "2 is PRIME"
HPCW2020_05_HordaksBoss(3) → "3 is PRIME"

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

public String HPCW2020_05_HordaksBoss(int x) { }

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

Post-solution available

Copyright Nick Parlante 2017 - privacy