Langsung ke konten utama

Postingan

Menampilkan postingan dari September, 2018

Tugas PBO Remote AC

Hey guys! In this post I'm going to show you how to make an AC Remote using BlueJ. I'm going to use 2 classes, which are: Main ACRemote Main /* * Main function for the AC Remote * * Elkana Hans Widersen * 05111740000127 * 23 September 2018 */ import java.util.Scanner; public class Main{ public static void main(String args[]){ int menu; Scanner input = new Scanner(System.in); //Creates the remote ACRemote remote = new ACRemote(); while(true){ //displays the remote interface every loop remote.display(); //scans for menu number menu = input.nextInt(); switch(menu){ //changes the temperature case 1: remote.TempUp(); break; case 2: remote.TempDown(); break; //sets the AC swing mode case 3: remote.getSwing(); break; //terminates when the AC turned off

Tugas 3 PBO A

Hey guys! This time I have been working on making my own Ticket Machine using BlueJ. I am using 2 classes, which is Main and TicketMachine . TicketMachine /* * This class contains the declaration of the Ticket Machine we are going to use.. * * @author (Elkana Hans Widersen) * @version (17/9/2018) */ import java.util.Scanner; public class TicketMachine{ Scanner scan = new Scanner(System.in); // 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 amount of tickets about to be printed. private int ticket; // The total amount of money collected by this machine. private int total; /* * Create a machine that issues tickets of the given price. * Note that the price must be greater than zero, and there * are no checks to ensure this. */ public TicketMachine(int ticketCost){

Tugas Rumah PBO A

Hey guys! In this post I am going to show what I have been working on this week. I am asked to draw a house from 2D Shapes compiled in BlueJ. In this project, I use 6 classes, which are: 1. Picture     This is the main method for displaying the house picture I have designed. /* * Make your Picture here. * * @author Elkana Hans Widersen * @version (16/9/2018) */ public class Picture{ private Rect BackWall, BorderWindow, Roof, LeftRoofBorder, FrontWall, DoorBorder, Land; private Triangle SideRoof, UpperWall, RightRoofBorder; private Square Window; private Circle WindowBorder, RightWindow, Sun; public void draw(){ Land = new Rect(); Land.moveHorizontal(-50); Land.moveVertical(220); Land.changeSize(300,30); Land.makeVisible(); Land.changeColor("green"); Sun = new Circle(); Sun.moveHorizontal(190); Sun.moveVertical(0); Sun.changeSize(50);

Tugas 2 PBO A

Hi. On today's post, I'm going to show you my next project about Java Class implementation related to 2D solid shapes. In this project, I'm going to use 6 solid shapes, which is a circle, a square, a triangle, a diamond, a parallelogram, and a rectangle. Check it out!  Class Structure 1. Main /** * Fungsi main di sini. * * @author (Elkana Hans Widersen) * @version (10/09/2018) */ public class myMain { public static void main(String args[]) { System.out.println("Lingkaran:"); Circle myCircle; myCircle = new Circle(); double crcArea = myCircle.Area(); double crcCircum = myCircle.Circum(); System.out.print("Luas = " + crcArea + ", "); System.out.println("Keliling = " + crcCircum + "\n"); System.out.println("Persegi:"); Square mySquare; mySquare = new Square(); double sqrArea =

Tugas 1 PBO A

This is my biodata compiled in Java (first time usage). Check it out! /** * Program membuat biodata menggunakan Java - BlueJ * * Author : Elkana Hans W * Version 1 , Date : 3 September 2018 */ public class biodata{ public biodata(){ System.out.print("PBO-Tugas1\n"); System.out.print("Nama\t: Elkana Hans Widersen\n"); System.out.print("Kelas\t: PBO A\n"); System.out.print("Alamat Rumah: Merak III/P2-104 Rewwin\n"); System.out.print("Email\t: elknhns@gmail.com\n"); System.out.print("Blog\t: elkanahans.blogspot.com\n"); System.out.print("No HP/WA: 082143646716\n"); System.out.print("Twitter\t: @elknhns\n"); } }