Advertisement
yanivtamari

targil car main

Jun 2nd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner s = new Scanner(System.in);
  7.         Car c1 = new Car();
  8.         System.out.println("enter car id: ");
  9.         c1.setCarid(s.next());
  10.         //show the car details
  11.         System.out.println(c1.ka()+c1.show());
  12.         //ask the user how much to speed the car and show the answer
  13.         System.out.println("enter how much to speed the car: ");
  14.         c1.setUserup(s.nextInt());
  15.         System.out.println(c1.ka()+c1.speedup());
  16.         //slow the car in 2 km
  17.         System.out.println(c1.ka()+c1.speeddown());
  18.         //stop the car
  19.         System.out.println(c1.ka()+c1.stop());
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement