Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- Car c1 = new Car();
- System.out.println("enter car id: ");
- c1.setCarid(s.next());
- //show the car details
- System.out.println(c1.ka()+c1.show());
- //ask the user how much to speed the car and show the answer
- System.out.println("enter how much to speed the car: ");
- c1.setUserup(s.nextInt());
- System.out.println(c1.ka()+c1.speedup());
- //slow the car in 2 km
- System.out.println(c1.ka()+c1.speeddown());
- //stop the car
- System.out.println(c1.ka()+c1.stop());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement