Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class gasmilage {
- public static void main(String[] args) {
- {
- float milesdriven;
- float gasgallons;
- float result;
- Scanner keyboard = new Scanner (System.in);
- System.out.println("Miles driven?");
- milesdriven = keyboard.nextFloat();
- System.out.println("Gallons of gas used?");
- gasgallons = keyboard.nextFloat();
- result = milesdriven / gasgallons;
- System.out.println("Results in miles per gallon is " + result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement