Package java.util

Examples of java.util.Scanner.nextFloat()


            this.As[0] = new float[numStreams][length][length];
            this.Bs[0] = new float[numStreams][length];

            for (int j = 0; j < length; j++) {
                for (int k = 0; k < length; ++k) {
                    As[0][i][j][k] = input.nextFloat();
                }
            }

            for (int j = 0; j < length; j++) {
                Bs[0][i][j] = input.nextFloat();
View Full Code Here


                    As[0][i][j][k] = input.nextFloat();
                }
            }

            for (int j = 0; j < length; j++) {
                Bs[0][i][j] = input.nextFloat();
            }
        }
        input.close();
    }
View Full Code Here

            flag = true;

            if (choice.equals("y")){
                try {
                    System.out.print("Заправить: ");
                    addEnergy = scanner.nextFloat();
                    System.out.print("Выбрать скарость: ");
                    newSpeed = scanner.nextFloat();
                    accelerate(addEnergy, newSpeed);
                }catch (InputMismatchException e){
                    addEnergy = 0;
View Full Code Here

            if (choice.equals("y")){
                try {
                    System.out.print("Заправить: ");
                    addEnergy = scanner.nextFloat();
                    System.out.print("Выбрать скарость: ");
                    newSpeed = scanner.nextFloat();
                    accelerate(addEnergy, newSpeed);
                }catch (InputMismatchException e){
                    addEnergy = 0;
                    newSpeed = 0;
                    distance = 0;
View Full Code Here

            flag = true;

            if (choice.equals("y")){
                try {
                    System.out.print("Заправить: ");
                    addFuel = scanner.nextFloat();
                    System.out.print("Выбрать скарость: ");
                    newSpeed = scanner.nextFloat();
                    accelerate(addFuel, newSpeed);
                }catch (InputMismatchException e){
                    addFuel = 0;
View Full Code Here

            if (choice.equals("y")){
                try {
                    System.out.print("Заправить: ");
                    addFuel = scanner.nextFloat();
                    System.out.print("Выбрать скарость: ");
                    newSpeed = scanner.nextFloat();
                    accelerate(addFuel, newSpeed);
                }catch (InputMismatchException e){
                    addFuel = 0;
                    newSpeed = 0;
                    distance = 0;
View Full Code Here

            flag = true;

            if (choice.equals("y")){
                try {
                    System.out.print("Заправить: ");
                    addFuel = scanner.nextFloat();
                    System.out.print("Выбрать скарость: ");
                    newSpeed = scanner.nextFloat();
                    accelerate(addFuel, newSpeed);
                }catch (InputMismatchException e){
                    addFuel = 0;
View Full Code Here

            if (choice.equals("y")){
                try {
                    System.out.print("Заправить: ");
                    addFuel = scanner.nextFloat();
                    System.out.print("Выбрать скарость: ");
                    newSpeed = scanner.nextFloat();
                    accelerate(addFuel, newSpeed);
                }catch (InputMismatchException e){
                    addFuel = 0;
                    newSpeed = 0;
                    distance = 0;
View Full Code Here

      System.out.println( "Enter a Float: " );
      while( !input.hasNextFloat() ) {
        input.nextLine();
        System.out.println( "Not a Float, try again" );
      }
      System.out.println( "You entered: " + input.nextFloat() );
  }
 
  public void r_1_7() {
   
    System.out.println( "Q: Write a Java class, Flower, that has three instance variables of type String, int, and float, which respectively represent the name of the flower, its number of pedals, and price." );
View Full Code Here

            } else {
                return new DatabaseFunction(stringVal);
            }
        } else if ((liquibaseDataType instanceof FloatType || typeId == Types.FLOAT)) {
            if (scanner.hasNextFloat()) {
                return scanner.nextFloat();
            } else {
                return new DatabaseFunction(stringVal);
            }
        } else if ((liquibaseDataType instanceof IntType || typeId == Types.INTEGER)) {
            if (scanner.hasNextInt()) {
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.