diff --git a/pom.xml b/pom.xml index 1efac6c..a23ddb7 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,10 @@ io.zipcoder MicroLabs-OOP-TooLargeTooSmall 1.0-SNAPSHOT + + 18 + 18 + \ No newline at end of file diff --git a/src/main/java/Main.java b/src/main/java/Main.java index 05e41a9..c235f77 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -1,9 +1,43 @@ +import java.util.Random; +import java.util.Scanner; + /** * Created by iyasuwatts on 10/17/17. */ public class Main { - + //public static String PrintResult(int userInput){ + //if(userInput < 5){ + //System.out.println("too small") + // } + //} public static void main(String[] args){ - + System.out.println("Zipcode rocks!"); + + int userInput; + Scanner in = new Scanner (System. in); + System.out.print ("Guess a number: "); + userInput = in.nextInt(); + Math.random(); + Random num = new Random(); + int randomNum1 = num.nextInt(10); + int userInputCount = 0; + userInputCount++; + System.out.println(userInputCount); + boolean correctGuess = false; + while (!correctGuess) { + + if (userInput == randomNum1) { + System.out.println("correct guess"); + } else if (userInput > randomNum1) { + System.out.println("too large"); } + else if (userInput < randomNum1) + {System.out.println("too small"); + } + + } + } + } -} + + +