SHARE
TWEET

gasmilage

a guest May 16th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. public class gasmilage {
  3.  
  4.     public static void main(String[] args) {
  5.         {
  6.             float milesdriven;
  7.             float gasgallons;
  8.             float result;
  9.            
  10.             Scanner keyboard = new Scanner (System.in);
  11.            
  12.         System.out.println("Miles driven?");
  13.             milesdriven = keyboard.nextFloat();
  14.            
  15.         System.out.println("Gallons of gas used?");
  16.         gasgallons = keyboard.nextFloat();
  17.        
  18.         result = milesdriven / gasgallons;
  19.  
  20.         System.out.println("Results in miles per gallon is " + result);
  21.         }  
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top