Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.lang.*;
- import java.util.*;
- public class FloatScanner
- {
- public static void main( String args[] )
- {
- Scanner in = new Scanner(System.in);
- float minSup, minConf;
- minSup = minConf = 0.0F;
- do
- {
- System.out.println("1)Insert a float value : ");
- minSup = in.nextFloat();
- // Dovresti inserire i valori semplicemente con la virgola, ( es. 0,33 -> 0.33 ) altrimenti generi un'eccezione di tipo InputMismatchException
- // che dovresti eventualmente gestire!
- } while ( minSup < 0.2 );
- System.out.println("MINSUP : " + minSup);
- do
- {
- System.out.println("2)Insert a float value : ");
- minConf = in.nextFloat();
- } while ( minConf < 0.3 );
- System.out.println("MINCONF : " + minConf);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement