Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. package ctangle;
  2. import java.util.Scanner;
  3. public class CarTester {
  4. public static void main(String[] args)
  5. {
  6. Scanner keyboard = new Scanner(System.in);
  7.  
  8. Car car1;
  9.  
  10. System.out.println("Enter The capacity (in liters):");
  11. double capa1 = keyboard.nextDouble();
  12.  
  13. System.out.println("Enter The fuel consumpion rate (in lt/km):");
  14. double fuelcon1 = keyboard.nextDouble();
  15.  
  16. System.out.println("Enter The amount of gas to fill:");
  17. double amounttofill1 = keyboard.nextDouble();
  18.  
  19. System.out.println("Enter The distance to drive:") ;
  20. double distance1 = keyboard.nextDouble();
  21.  
  22.  
  23. car1 = new Car(capa1 , fuelcon1 );
  24.  
  25.  
  26. System.out.println("Gas remaining in tank: "+car1);
  27.  
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement