Results 1 to 2 of 2
  1. #1
    MAJ
    MAJ is offline Member
    Join Date
    Jul 2014
    Posts
    17
    Rep Power
    0

    Default Missing Indentifier

    import java.util.*; //input from library of routines
    public class guessingGame
    {
    public static void main(String[] args)
    {
    int sN = 7;
    int yourGuess;
    int guessCount = 0;

    Scanner myInput = new scanner(system.in);

    do {
    System.out.println.("Pick a number between 1 and 10");
    System.out.println("What is your guess?");
    yourGuess = myInput.nextInt();
    guessCount = guesscount + 1;
    System.out.println("That was guess number" + guessCount);

    if (yourGuess < sN)
    System.out.println("Too low. Guess higher!");
    if (yourGuess >sN)
    System.out.println("Too High. Guess lower!");

    }while (yourGuess != sN);

    System.out.println("\n\n");
    System.out.println("You got it in" + guessCount + "guesses");

    if (guessCount > 3) System.out.println("You took too many guesses!");
    }
    }
    I'm getting an error that says identifier expected and the compiler points to this as the problem:("Pick a number between 1 and 10");
    What am I missing?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default Re: Missing Indentifier

    You're not missing anything, you have one character too many, i.e. remove that dot after the 'println' method name on that offending line.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. What am I missing?
    By jean28 in forum New To Java
    Replies: 4
    Last Post: 10-28-2012, 05:31 PM
  2. org.j3d is missing...
    By LinuxDev@Flanders in forum Java Gaming
    Replies: 3
    Last Post: 07-23-2012, 12:31 PM
  3. What am I missing here?
    By PuppetJacks in forum New To Java
    Replies: 4
    Last Post: 07-01-2012, 11:16 AM
  4. Replies: 3
    Last Post: 02-29-2012, 06:44 PM
  5. What am I missing here..?
    By andrew_smiley in forum New To Java
    Replies: 5
    Last Post: 02-22-2012, 01:47 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •