Looking for a similar answer, essay, or assessment help services?

Simply fill out the order form with your paper’s instructions in a few easy steps. This quick process ensures you’ll be matched with an expert writer who
Can meet your papers' specific grading rubric needs. Find the best write my essay assistance for your assignments- Affordable, plagiarism-free, and on time!

Posted: January 6th, 2020

Java Guessing Game, computer science homework help

Question description

I'm having a few problems with a java guessing game. I'm supposed to have my code think up a random number and then prompt the user to input what I'm thinking until they get it right. I have a bug in my program because it always says the number is lower whether it is higher or lower but when I input the max number, it says I got it right. I don't know where I went wrong. Any help is much appreciated! I'm going to link my code and the assignment specifications: http://courses.cs.washington.edu/courses/cse142/16wi/homework/5/spec.pdf import java.util.*;public class GuessingGame {   public static void main(String[] args) {      game();      statistics();   }      public static void game() {      Random random = new Random();      Scanner console = new Scanner(System.in);      int num = random.nextInt(50);      int guess = 0;      int guess_count = 0;      System.out.println("I'm thinking of a number between 1 and " + num);      while (guess != num) {         System.out.println("Your guess? ");         guess = console.nextInt();         guess_count++;         if (guess > num) {            System.out.println("It's higher.");         } else if (guess < num) {            System.out.println("It's lower.");         } else {            System.out.println("You got it right in " + guess_count + " guesses");         }      }        System.out.println("Do you want to play again? ");      System.out.println();   }      public static void statistics() {      System.out.println("Overall results:");      System.out.println("Total games = ");      System.out.println("Total guesses = ");      System.out.println("Guesses/game = ");      System.out.println("Best game = ");   }}

Tags: Ace-myhomework Assignment, Affordable College Homework, APA Citation Assignment Help, Custom Essay Writing

Order|Paper Discounts

Why Choose Essay Bishops?

You Want The Best Grades and That’s What We Deliver

Top Essay Writers

Our top essay writers are handpicked for their degree qualification, talent and freelance know-how. Each one brings deep expertise in their chosen subjects and a solid track record in academic writing.

Affordable Prices

We offer the lowest possible pricing for each research paper while still providing the best writers;no compromise on quality. Our costs are fair and reasonable to college students compared to other custom writing services.

100% Plagiarism-Free

You’ll never get a paper from us with plagiarism or that robotic AI feel. We carefully research, write, cite and check every final draft before sending it your way.