Package java.util

Examples of java.util.Scanner.nextInt()


            for(int id = 0; id < MoveController.robotsCount; id++){

                scan = new Scanner(fnames.get(id));

                if(scan.hasNext()){
                    first = new Point(scan.nextInt(), scan.nextInt());
                    MoveController.trajectoryPoints.elementAt(id).add(first);
                }
                else{
                    RemoteLRControlApp.writeToErr("ERROR: Trajectory file '" + fnames.get(id) + "' is empty.");
               
View Full Code Here


                MoveController.trajectoryPoints.add(new Vector<Point>());

                while(scan.hasNext()){
                    second = first;
                    first = new Point(scan.nextInt(), scan.nextInt());

                    while((first.distance(second) < MoveController.discretisation) && scan.hasNext())
                        first.setLocation(scan.nextInt(), scan.nextInt());

                    MoveController.trajectoryPoints.elementAt(id).add(first);
View Full Code Here

                MoveController.trajectoryPoints.add(new Vector<Point>());

                while(scan.hasNext()){
                    second = first;
                    first = new Point(scan.nextInt(), scan.nextInt());

                    while((first.distance(second) < MoveController.discretisation) && scan.hasNext())
                        first.setLocation(scan.nextInt(), scan.nextInt());

                    MoveController.trajectoryPoints.elementAt(id).add(first);
View Full Code Here

                while(scan.hasNext()){
                    second = first;
                    first = new Point(scan.nextInt(), scan.nextInt());

                    while((first.distance(second) < MoveController.discretisation) && scan.hasNext())
                        first.setLocation(scan.nextInt(), scan.nextInt());

                    MoveController.trajectoryPoints.elementAt(id).add(first);
                }

                scan.close();
View Full Code Here

                while(scan.hasNext()){
                    second = first;
                    first = new Point(scan.nextInt(), scan.nextInt());

                    while((first.distance(second) < MoveController.discretisation) && scan.hasNext())
                        first.setLocation(scan.nextInt(), scan.nextInt());

                    MoveController.trajectoryPoints.elementAt(id).add(first);
                }

                scan.close();
View Full Code Here

      // arr�t du pgr et affichage des donn�es
      System.out.println("Etat : " + currentState + ", Action : " + selectedAction);
     
      // attente que l'utilisateur donne l'�tat engendr� et sa note
      System.out.println("Quel est l'�tat engendr� ?");
      newState = input.nextInt();
     
      System.out.println("Quelle note donnez vous ?");
      userScore = (float) input.nextDouble(); // !! mettre une virgule dans la console (pas de .)
      // dans cette fen�tre l'utilisateur pourra d�cider de sauvegarder la matrice des QValues (boolean wantToSave)
     
View Full Code Here

   *            not used
   */
  public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    System.out.print("Enter the number of games to run: ");
    int numGames = s.nextInt();

    for (int a = 0; a < 3; a++) {
      RPSScoreKeeper rpsScoreKeeper = new RPSScoreKeeper();

      RPSThrow p1 = new RPSThrow(a);
View Full Code Here

 
  if ( kodes.equals(kode[0]))
  {
    System.out.println("2500");
    System.out.println("Quantity: ");
    quantity = a.nextInt();
    total = quantity * 2500;
    System.out.println("Total harga yang harus dibayar: Rp."+total);
  }else if (kodes.equals(kode[1]))
    {
    System.out.println("25000");
View Full Code Here

    System.out.println("Total harga yang harus dibayar: Rp."+total);
  }else if (kodes.equals(kode[1]))
    {
    System.out.println("25000");
    System.out.println("Quantity: ");
    quantity = a.nextInt();
    total = quantity * 25000;
    System.out.println("Total harga yang harus dibayar: Rp."+total);
  }else if (kodes.equals(kode[2]))
  {
    System.out.println("4500");
View Full Code Here

    System.out.println("Total harga yang harus dibayar: Rp."+total);
  }else if (kodes.equals(kode[2]))
  {
    System.out.println("4500");
    System.out.println("Quantity: ");
    quantity = a.nextInt();
    total = quantity * 4500;
    System.out.println("Total harga yang harus dibayar: Rp."+total);
  }else if (kodes.equals(kode[3]))
  {
    System.out.println("1200");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.