User Tools

Site Tools


guess_my_rule

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
guess_my_rule [2022/08/11 10:02] frchrisguess_my_rule [2022/08/11 10:09] (current) frchris
Line 19: Line 19:
 public class GuessMyIntegerRule  public class GuessMyIntegerRule 
 { {
- private String secretRule = "It must be prime";+ //  Change secretRule to make your own rule 
 +        private String secretRule = "It must be prime"; 
 +        
  public boolean DoesThisIntFollowMyRule(int n)   public boolean DoesThisIntFollowMyRule(int n) 
  {  {
 + // change this code for checking if n follows your rule.
  for(int i = 2; i < n; i++)  for(int i = 2; i < n; i++)
  if (n % i == 0)  if (n % i == 0)
Line 111: Line 114:
 } }
 </code> </code>
 +====Rubric====
 +  - Name and seat in a comment?
 +  - Unique secret rule
 +  - Hint provided
 +  - Attempt to test if input follows the rule
 +  - Functions according to spec
 +  - Follows best practices (names of variables, indenting, etc)
guess_my_rule.1660226530.txt.gz · Last modified: 2022/08/11 10:02 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki