Code example for Scanner

Methods: nextDoublenextInt

0
				    
				   { 
				      int miles;
				      double gallons, mpg;
 
				      Scanner scan = new Scanner (System.in);
				      System.out.print ("Enter the grade: ");
				      miles = scan.nextInt();
 
				      System.out.print (": ");
				      gallons = scan.nextDouble();
 
				       
				   } 
				 
 
 
		   } 
		 
 
Experience pair programming with AI  Get Codota for Java