BIKE RENTAL APPLICATION
BASED ON JAVA IN PESMA
Oleh:
1. Herda Pundhi Saputra (L200174033)
PROGRAM STUDI INFORMATIKA
FAKULTAS KOMUNIKASI DAN INFORMATIKA
UNIVERSITAS MUHAMMADIYAH SURAKARTA
2018
PRELIMINARY
1.1 Background
Current technological advancements have increasingly developed. As one of the
technology products is a computer that is very beneficial for the community. Computers also
make work processes more efficient, effective and provide better and faster work results.
Bicycles are certainly a tool that is often used among students, because the price is
affordable and cheap in their care.
Rental is a service that provides facilities for renting and borrowing.
Many of the students from outside who migrate and lack of transportation to travel become
one of the important factors this application is made.
How to facilitate the workmanship in entering data and giving accurate results in
processing data and presenting data, it requires an application using java. With the application,
it is expected to accelerate services to students to borrow bicycles accurately, students can enter
their IDs and find out the price of renting a bicycle they want.
BAB II
OBJECT-ORIENTED CONCEPT
2.1 Class
Creating a java application that has several classes with names:theBike
• Jemboly
• Tester
2.2 Objects
Objects are real implementations of a class (instance of the class). Here are some objects that
we use:
• inputbike1 from class Scanner
• bike from class theBike
• inputsewa1 from class Scanner
2.3 Methods
a. Procedure
• setSepeda
• setColor
• setJenis_Sepeda
• setType_sewa
• setLama_sewa
• setnamaPenyewa
• setLama
b. Function
• getSepeda
• getColor
• getType_sewwa
• getLama_sewa
• getNamaPenyewa
• getBayarSewa
• getJenis_Sepeda
c. Constructor
• theBike
• Jemboly
2.4 Variables
a. Constant Variables
• Biayapenyewaan
b. Local Variables
There are Local Variabel in procedure:
• Id_Sepeda
• Col
• Jenis_Sep
• Type
• Lama_sewa
• type_sewa
• namapenyewa
c. Instance Variables
• id_mobil
• IdSepeda
• Color
• Jenis_Sepeda
• namaPenyewa
• type_penyewaan
• lama_penyewaan
• bayar_penyewaan
d. Class Variables
• jumlahSepeda
2.5 Package
• package herda_project;
•
2.6 Access Modifier
Public :
• public class theBike
• public class Jemboly
• public class Tester
• public int biayaPenyeaan
• public static int jumlahSepeda
• public int getSepeda
• public String getColor
• public int getType_sewa
• public int getLama_sewa
• public String getNamaPenyewa
• public int getBayarSewa
• public void setColor
• public void setType_sewa
• public void setLama_sewa
• public void setNamaPenyewa
• public void setJenis_Sepeda
• public final int biayaPenyewan = 7500
• public String Diskon
Protected :
• Protected String getJenis_Sepeda
• Protected void setSepeda(String Jenis_sepeda)
a. No Modifier
• theBike()
• theBike(String Col ,String jenis_sep )
• class penyewaan()
• void infoSewa()
• void Informasi()
b. Private
• private int idSepeda
• private String Color, Jenis_sepeda
2.7 Inheritance
Terdapat inheritance :
• public class Jemboly extends theBike
Class Jemboly merupakan subclass dari superclass theBike
• public class theBike extends Abstract
Class theBike merupakan subclass dari Superclass Abstract
2.8 Encapsulation
a. Setter Method
• setSepeda
• setColor
• setJenis_sepeda
• setLama_Sewa
• setnamaPenyewa
• setType_sepeda
b. Getter Method
• getSepeda
• getColor
• getLama_Sewa
• getBayarSewa
• getnamaPenyewa
• getType_sewa
2.9 Polymorpisme
a. Overloading
Terdapat methods yang memiliki nama sama, tetapi input paramaeter berbeda dan
berada
• theBike()
• theBike(String color, String jenis_sep )
b. Overriding
Terdapat methods yang memiliki nama dan input parameter sama, tetapi berada di
hierarki yang berbeda:
• public void informasi()
• public void setSepeda()
• public void setColor()
2.10 Abstraction
Terdapat pada interface bernama:
• void informasi();
• public abstract class Abstract
• public abstract int getSepeda();
• public abstract void setSepeda();
• public abstract String getColor();
• public abstract void setColor();
2.11 Interface
Terdapat interface yang bernama:
• Info
BAB III
IMPLEMENTASI KOD
3.1 Class theBike
TheBike class is in the herda_project package and theBike class is one of the derivatives of
Abstract, in which methods are used to set and retrieve data. And in this class there is a class
rental, which is a nested class, in which there are also methods to set and upload data.
3.2 Class jemboly
The Jemboly class is in the package herda_project and is a derivative subclass of theBike class.
And in this class there is an override from theBike class.
3.3 Interface info
Interface info is in packages herda_project, in which there are also abstract methods that must be
defined in the class that implements the interface
3.4 Abstract
Abstract class is in packages herda_project which implements info
3.5 Class Tester
This Class Tester is in packages herda_project which in it creates a new object from the class
jemboly which sets data data that has been requested by creating objects from the scanner class
then displaying the results. Then create a new object again from the rental class that is in theBike
class then set the data data again requested by Sacnner then display the results