0rx

Mobil_Class

0rx
May 16th, 2020
1,301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.27 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6.  
  7. /**
  8.  *
  9.  * @author baskoro
  10.  */
  11. public class Mobil {
  12.    
  13.     public String kode, nama, kapasitas;
  14.     public int lamaSewa;
  15.     public int hargaSewaPerHari;
  16.    
  17.     public void seleksiKode(){
  18.         if(kode.equalsIgnoreCase("M0001")){
  19.             nama                = "Avanza";
  20.             kapasitas           = "7";
  21.             hargaSewaPerHari    = 400000;
  22.         }
  23.         else if(kode.equalsIgnoreCase("M0002")){
  24.             nama                = "Agya";
  25.             kapasitas           = "5";
  26.             hargaSewaPerHari    = 350000;
  27.         }
  28.         else if(kode.equalsIgnoreCase("M0003")){
  29.             nama                = "BRV";
  30.             kapasitas           = "7";
  31.             hargaSewaPerHari    = 500000;
  32.         }
  33.         else if(kode.equalsIgnoreCase("M0004")){
  34.             nama                = "Brio";
  35.             kapasitas           = "5";
  36.             hargaSewaPerHari    = 350000;
  37.         }
  38.         else {
  39.             nama                = "";
  40.             kapasitas           = "";
  41.             hargaSewaPerHari    = 0;
  42.         }
  43.     }
  44.    
  45.    
  46. }
Advertisement
Add Comment
Please, Sign In to add comment