Nama : Dara Tursina NRP : 5115100707 Kelas : PBO Bank merupakan tempat berkumpulnya masyarakat untuk menyimpan atau pun mengambil uang. Sebelum melakukan transaksi biasanya nasabah diminta mengambil nomor antrian di mesin pencetak antrian.Mesin pencetak antrian bank adalah system yang berfungsi untuk mengelola nomor urut antrian nasabah bank. Mesin ini mempunyai fungsi, mempermudah teller dan customer service, atau layanan lain pada bank tersebut, memanggil nasabah dan melayani sesuai dengan keperluan nasabah, pada masing-masing layanan. CLASS MESIN ANTRIAN CLASS ANTRIAN CLASS TELLER CLASS CUSTOMER SERVICE CLASS SCREEN CLASS WAKTU OUTPUT :
Postingan
- Dapatkan link
- X
- Aplikasi Lainnya
*Account Class with an Instance Variable of Type double* // Fig. 3.13: Account.java // Account class with a constructor to validate and // initialize instance variable balance of type double. *AccountTest Class to Use Class Account* // Fig. 3.14: AccountTest.java // Inputting and outputting floating-point numbers with Account objects. Output : *Displaying Text in a Dialog Box* The programs presented thus far display output in the command window. Many applications use windows or dialog boxes (also called dialogs) to display output. Web browsers such as Firefox, Internet Explorer, Chrome and Safari display web pages in their own windows. E-mail programs allow you to type and read messages in a window. Typically, dialog boxes are windows in which programs display importantmessages to users. Class JOption- Pane provides prebuilt dialog boxes that enable programs to display windows containing messages—such windows are called message dialogs // Fig. 3.17: Dialog1.java...
- Dapatkan link
- X
- Aplikasi Lainnya
Composition & Enumerations A. COMPOSITION Composition adalah dimana hubungan suatu object bergantung dengan objek lainnya. Berikut ini program class Date, class Employee dan class EmployeeTest. Source Code : Class Date // Fig. 8.7: Date.java // Date class declaration. public class Date { private int month; private int day; private int year; private static final int[] daysPerMonth = //days in each month {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; //contruktor : call checkMonth to confirm proper value for month; //call checkDay to confirm proper value for day public Date (int theMonth, int theDay, int theYear) { month = checkMonth(theMonth); year = theYear; day = checkDay(theDay); System.out.printf ("Date object constructor for date %s\n", this); } //utility method to confirm proper month value private int checkMon...
- Dapatkan link
- X
- Aplikasi Lainnya
Studi Kasus : Mesin Tiket Ticket Machine Case Study (Studi Kasus Mesin Tiket) Ticket Machine adalah sebuah mesin seperti ATM, yang berfungsi melayani penjualan tiket kereta api dari satu tujuan ke tujuan yang lain. Di dalam Ticket Machine ada sebuah program atau perangkat lunak yang mengatur harga tiket di tiap tujuan, mengatur kembalian uang, dan juga mencetak receipt sebagai bukti pembelian tiket. Berikut ini program TicketMachine dan program pengaplikasiannya (IntMain) : Source code : Program TicketMachine public class TicketMachine { // The price of a ticket from this machine private int price; // The amount of money entered by a customer so far. private int balance; // The total amount of money collected by this machine. private int total; public TicketMachine(int ticketCost) { price = ticketCost; balance = 0; total = 0; } public int getPrice() { return price; } public int getBalance() { ...
- Dapatkan link
- X
- Aplikasi Lainnya
// Fig. 8.1: Time1java //Time1 class declaration maintains the time in 24-hour format. public class Time1 { int hour; int minute; int second; public void setTime( int h, int m, int s) { if ( ( h >= 0 && h < 24 ) && ( m >= 0 && m < 60 ) && ( s >= 0 && s < 60 ) ) { hour = h; minute = m; second = s; } else throw new IllegalArgumentException( "hour, minute and/our second was out of range"); } public String toUniversalString() { return String.format("%02d:02d:%02d", hour,minute,second); } public String toString() { return String.format("%d:%d02:%d02 %s", ( ( hour == 0 || hour == 12 ) ? 12 : hour % 12 ), minute, second, (hour < 12 ? "AM" : "PM" ) ) ; } } // Fig.8.2: Time1Test.java // Time1 object used in ...
- Dapatkan link
- X
- Aplikasi Lainnya
Pemograman Berbasis Objek KONSEP OBJEK 1. Objek Objek merupakan sesuatu yang memiliki identitas (nama), pada umumnya juga memiliki data tentang dirinya maupun object lain dan mempunyai kemampuan untuk melakukan sesuatu dan bisa bekerja sama dengan objek lainnya. Contoh object : Rumah, mobil, sepeda motor, meja, dan komputer merupakan contoh-contoh object yang ada di dunia nyata. 2. Property Property (atau disebut juga dengan atribut) adalah data yang terdapat dalam sebuah class. Melanjutkan analogi tentang laptop. Contoh property dari laptop bisa berupa merk, warna, jenis processor, ukuran layar, dan lain-lain. 3. Method Method pada dasarnya adalah function yang berada di dalam class. Seluruh fungsi dan sifat function bisa diterapkan kedalam method, seperti argumen/parameter, mengembalikan nilai (dengan keyword return), dan lain-lain.Method adalah tindakan yang bisa dilakukan didalam class. Jika menggunakan analogi class laptop kita....