1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Scanner Help? (java)

  1. Sep 29, 2007 #1
    Hi,

    I'm trying to create this output:

    Input team 1's name:
    Team 1
    Input team 1's ranking:
    90.4
    etc.

    For 8 teams.

    This is what I have:


    import java.util.Scanner;

    public class Tournament {
    public static void main(String args[]) {
    System.out.println("Input team 1's name:");
    Scanner a = new Scanner(System.in);
    System.out.println("Input team 1's ranking:");
    Scanner b = new Scanner(System.in);
    System.out.println("Input team 2's name:");
    Scanner c = new Scanner(System.in);
    System.out.println("Input team 2's ranking:");
    Scanner d = new Scanner(System.in);
    System.out.println("Input team 3's name:");
    Scanner e = new Scanner(System.in);
    System.out.println("Input team 3's ranking:");
    Scanner f = new Scanner(System.in);
    System.out.println("Input team 4's name:");
    Scanner g = new Scanner(System.in);
    System.out.println("Input team 4's ranking:");
    Scanner h = new Scanner(System.in);
    System.out.println("Input team 5's name:");
    Scanner i = new Scanner(System.in);
    System.out.println("Input team 5's ranking:");
    Scanner j = new Scanner(System.in);
    System.out.println("Input team 6's name:");
    Scanner k = new Scanner(System.in);
    System.out.println("Input team 6's ranking:");
    Scanner l = new Scanner(System.in);
    System.out.println("Input team 7's name:");
    Scanner m = new Scanner(System.in);
    System.out.println("Input team 7's ranking:");
    Scanner n = new Scanner(System.in);
    System.out.println("Input team 8's name:");
    Scanner o = new Scanner(System.in);
    System.out.println("Input team 8's ranking:");
    Scanner p = new Scanner(System.in);

    }

    }

    But when I try to compile it gives me 33 errors: "Tournament.java:36: cannot resolve symbol
    symbol : class Scanner
    location : class Tournament
    Scanner [whatever variable]= new Scanner(System.in);"

    Even if it does complie will the code I provided produce that output?

    Any ideas?

    Thanks
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you help with the solution or looking for help too?



Similar Discussions: Scanner Help? (java)
  1. Thermo Help! (Replies: 0)

  2. JAVA indexOf() method (Replies: 0)

Loading...