Postingan

Menampilkan postingan dari September, 2018
Gambar
Tugas Membuat Digital Clock Dibawah ini merupakan Gambar classnya Dibawah ini Merupakan Codingan dari Class Clock Display : /** * Codingan Clock Display * * @author M Thalut Nadhil Q * @version 5 */ public class ClockDisplay { private NumberDisplay jam; private NumberDisplay menit; private String displayString; public ClockDisplay() { jam = new NumberDisplay(24); menit = new NumberDisplay(60); updateDisplay(); } public ClockDisplay(int hour, int minute) { jam = new NumberDisplay(24); menit = new NumberDisplay(60); setTime(hour,minute); } public void timeTick() { menit.increment(); if(menit.getValue() == 0) { jam.increment(); } updateDisplay(); } public void setTime(int hour, int minute) { jam.setValue(hour); menit.setValue(minute); updateDisplay(); }
Gambar
Tugas Membuat Software Remote Tv 1. Foto Clas-classnya 2. Kodingan Mainnya /** * Membuat Software Remote Tv (Main) * * @author M Thalut Nadhil Q * @version 3 */ import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int mainmenu; int nomor; int channel; int volume; int flag = 1; Remote remote = new Remote(); System.out.println("1. Nyalakan TV"); System.out.println("2. Ganti Channel"); System.out.println("3. Channel Sekarang"); System.out.println("4. Channel Selanjutnya"); System.out.println("5. Channel Sebelumnya"); System.out.println("6. Cek Volume"); System.out.println("7. Naikkan Volume"); System.out.println("8. Turunkan Volume"); System.out.println("9. Mute");
Gambar
Pada tanggal 17 September 2018, lebih tepatnya jam 11.00 tadi saya diberikan tugas untuk membuat software mesin tiket 1. Foto classnya 2. Kodingan Class TicketMachine /** * software for TicketMachine * * @author M Thalut Nadhil Q * @version 3 */ 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() { return balance;} public void insertMoney(int amount) { balance = balance + amount; } public void printTicket() { System.out.println("################"); System.out.println("#
Gambar
Tugas Menggambar Pemandangan 1. Foto Classnya 2. Canvas import javax.swing.*; import java.awt.*; import java.util.List; import java.util.*; /** * Canvas is a class to allow for simple graphical drawing on a canvas. * This is a modification of the general purpose Canvas, specially made for * the BlueJ "shapes" example. * * @author: M Thalut Nadhil Q * * */ public class Canvas { // Note: The implementation of this class (specifically the handling of // shape identity and colors) is slightly more complex than necessary. This // is done on purpose to keep the interface and instance fields of the // shape objects in this project clean and simple for educational purposes. private static Canvas canvasSingleton; /** * Factory method to get the canvas singleton object. */ public static Canvas getCanvas() { if(canvasSingleton == null) {
Gambar
Gambar Mainnya 1. Kodingan Main /** * Write a description of class MyMain here. * * @author (M Thalut Nadhil Q) * @version (1) */ class MyMain { public static void main(String args[]) { Kubus myKubus; myKubus = new Kubus(); myKubus.sisikubus=5; double volumekubus = myKubus.volumekubus(); double luaspermukaankubus = myKubus.luaspermukaankubus(); System.out.println("Volume Kubus = "+volumekubus); System.out.println("Luas Permukaan Kubus = "+luaspermukaankubus+"\n"); Balok myBalok; myBalok = new Balok(); myBalok.panjangbalok=3; myBalok.lebarbalok=4; myBalok.tinggibalok=5; double volumebalok = myBalok.volumebalok(); double luaspermukaanbalok = myBalok.luaspermukaanbalok(); System.out.println("Volume Balok = "+volumebalok); System.out.println("Luas Permukaan Balok = "+luaspermu

Tugas 1 PBO B

Gambar
Dibawah ini merupakan hasil Outputnya : Dibawah ini merupakan hasil tampilan dari bagian class : Dibawah ini merupakan Source Codenya : /** * Write a description of class Tugas1PBOB here. * * @author (M Thalut Nadhil Q) * @version (1/202020202020) */ public class Tugas1PBOB { // instance variables - replace the example below with your own private int x; /** * Constructor for objects of class Tugas1PBOB */ public Tugas1PBOB() { // initialise instance variables x = 0; System.out.print("Tugas #PBOB-Tugas1\n"); System.out.print("====================\n"); System.out.print("Nama \t\t: M Thalut Nadhil Q\n"); System.out.print("Kelas \t\t: PBO B\n"); System.out.print("Alamat Rumah \t: Jln. Panjang Cidodol, komplek lemigas Blok A nomor 5, Jakarta Selatan\n"); System.out.print("Email \t\t: thalut.nadhil@gmail.com\n
/** * Mengenal Bluej. * * @author M Thalut Nadhil * @version (1/2082020202) */ public class Helloworld { // instance variables - replace the example below with your own private int x; /** * Constructor for objects of class Helloworld */ public Helloworld() { // initialise instance variables x = 0; System.out.print("Hello world"); } /** * An example of a method - replace this comment with your own * * @param y a sample parameter for a method * @return the sum of x and y */ public int sampleMethod(int y) { // put your code here return x + y; } }