yanivtamari

targil car car

Jun 2nd, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. public class Car {
  2.     private String carid;
  3.     private int speedcar, userup;
  4.  
  5.     public String getCarid() {
  6.         return carid;
  7.     }
  8.  
  9.     public void setCarid(String carid) {
  10.         this.carid = carid;
  11.     }
  12.  
  13.     public int getSpeedcar() {
  14.         return speedcar;
  15.     }
  16.  
  17.     public int getUserup() {
  18.         return userup;
  19.     }
  20.  
  21.     public void setUserup(int userup) {
  22.         this.userup = userup;
  23.     }
  24.  
  25.     public String show() {
  26.         String ss = "the speed car is: " + (speedcar = 60);
  27.         return ss;
  28.     }
  29.  
  30.     public String speedup() {
  31.         String up = "the speed car now is: " + (speedcar + userup);
  32.         return up;
  33.     }
  34.  
  35.     public String speeddown() {
  36.         String d = "the speed car after slow is: " + (speedcar - 2);
  37.         return d;
  38.     }
  39.  
  40.     public String stop() {
  41.         String s = "the car is stop and now the speed is: " + (speedcar = 0);
  42.         return s;
  43.     }
  44.     public String ka(){
  45.         String ci= "the number of car is: "+(carid)+"\n";
  46.         return ci;
  47.     }
  48. }
Add Comment
Please, Sign In to add comment