Advertisement
Alfiekins

EncapTest

Oct 28th, 2021 (edited)
1,040
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.44 KB | None | 0 0
  1. public class EncapTest {
  2.    
  3.     private String num;
  4.     private String brand;
  5.     private String model;
  6.     private String status;
  7.     private int price;
  8.  
  9.     public String getNum() {
  10.         return num;
  11.     }
  12.  
  13.     public String getBrand() {
  14.         return brand;
  15.     }
  16.  
  17.     public String getModel() {
  18.         return model;
  19.     }
  20.  
  21.     public String getStatus() {
  22.         return status;
  23.     }
  24.  
  25.     public double getPrice() {
  26.         return price;
  27.     }
  28.    
  29.     public void setNum(String num) {
  30.         this.num = num;
  31.     }
  32.  
  33.     public void setBrand(String brand) {
  34.         this.brand = brand;
  35.     }
  36.  
  37.     public void setModel(String model) {
  38.         this.model = model;
  39.     }
  40.  
  41.     public void setStatus(String status) {
  42.         this.status = status;
  43.     }
  44.  
  45.     public void setPrice(int price) {
  46.         this.price = price;
  47.     }
  48.    
  49.     public void priceDecider(String brand, int price) {
  50.         if (this.brand == "Honda") {
  51.             this.price = 9000;
  52.            
  53.         } else if(this.brand == "Hyundai") {
  54.             this.price = 9000;
  55.            
  56.         } else if(this.brand == "Mitsubishi") {
  57.             this.price = 8500;
  58.            
  59.         } else if(this.brand == "Nissan") {
  60.             this.price = 8000;
  61.            
  62.         } else if(this.brand == "Toyota") {
  63.             this.price = 7500;
  64.            
  65.         } else {
  66.             this.price = 10000;
  67.            
  68.         }
  69.     }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement