Conditional statements in Java

Conditional statements in Java.

Requirements:

There are two files provided for this assignment. GuessingGame.java contains the class you are required to complete. It contains one method/function (plus a main method). At the top of the method is documentation that indicates what the method should do. Update the code in the method to meet the requirements.

Make sure that messages printed to the console meet the requirements exactly. The test is case sensitive and does not tolerate typos or extra white space.

To test your solution, you’ll need to run the JUnit test. Once you’ve created your file with the required code your can compile and run the test. Use the following steps:

  1. Create a new folder.
  2. Put junit-4.12.jar and hamcrest-core-1.3.jar in this folder (available below).
  3. Copy the test code with possible supporting files in this same folder.
  4. Create the file with code as required.
  5. Compile your code and the test code using the command javac -cp .:junit-4.12.jar:hamcrest-core-1.3.jar *.java
  6. Run the test using the command java -cp .:junit-4.12.jar:hamcrest-core-1.3.jar org.junit.runner.JUnitCore <test class>

Please do not change the original format of the java file. Follow the instruction, that was given in the comment (in java file). Provide a screenshot that it worked in JUnit test.

 

Last Updated on February 10, 2019 by EssayPro