Minggu, 23 September 2018

TUGAS PBO B (Tugas Rumah 3)

Membuat Sistem Remote TV




1. Source code Remote

 /**  
  * Membuat Program Remot Tv.  
  *  
  * @author (Christine Amelia)  
  * @version (5-23/09/2018)  
  */  
 public class RemotTV  
 {  
   public boolean status,status1;   
   public int channel,volume,sign;   
   public RemotTV()   
   {   
    status=false;    
    channel=1;   
    volume=0;   
   }   
   public void StatusTV(boolean status1) //function to ON/OFF TV   
   {   
    if(status1==true)   
    {   
     status= false;   
    }    
    else   
    {   
     status= true;   
    }   
   }   
   public void ChannelTV(int sign)   
   {   
    if(status==false) //Cannot change the channel when the TV status is OFF   
    {   
     System.out.println("Please turn ON the TV");   
    }   
    else   
    {   
     if(sign==1)   
     {   
      if(channel<10)   
      {   
       channel++;   
      }   
      else   
      {   
       channel=1;   
      }   
     }   
     else   
     {   
      if(channel>1)   
      {   
       channel--;   
      }   
      else   
      {   
       channel=10;   
      }  
     }  
   }  
   }  
   public void VolumeTV(int sign)   
   {   
    if(status==false) //Cannot change the volume when the TV status is OFF   
    {   
     System.out.println("Please turn ON the TV");   
    }   
    else   
    {   
     if(sign==1)   
     {   
      if(volume<10)   
      {   
       volume++;   
      }   
      else   
      {   
       System.out.println("Volume maximum");   
      }   
     }   
     else   
     {   
      if(volume>0)   
      {   
       volume--;   
      }   
      else   
      {   
       System.out.println("Volume minimum");   
      }   
     }   
    }  
   }  
 }  



2. Source code Main

 /**  
  * Membuat Program Remot TV.  
  *  
  * @author (Christine Amelia)  
  * @version (5-23/09/2018)  
  */  
  import java.util.Scanner;   
 public class MyMain  
 {    
   public static void main(String args[])   
   {   
    Scanner sc = new Scanner(System.in);    
    int menu,pilihan;   
    RemotTV Rmt;   
    Rmt=new RemotTV();    
    while(true)   
    {   
     System.out.println("=================================================");    
     System.out.println("====================Remote TV====================");    
     System.out.println("=================================================");    
     System.out.print("====Status:");   
     if(Rmt.status==false) //check the TV status  
     {   
      System.out.print("Off===");   
     }   
     else   
     {   
      System.out.print("On===");   
     }   
     System.out.print("Volume:"+Rmt.volume+"===");   
     System.out.print("Channel:");   
     switch(Rmt.channel) //Switch channel   
     {   
      case 1:   
      System.out.println("1.RCTI========");   
      break;   
      case 2:   
      System.out.println("2.GLOBAL TV===");   
      break;   
      case 3:   
      System.out.println("3.MNC TV======");   
      break;   
      case 4:   
      System.out.println("4.TRANS TV====");   
      break;   
      case 5:   
      System.out.println("5.SCTV========");   
      break;  
      case 6:  
      System.out.println("6.Trans 7=====");  
      break;  
      case 7:  
      System.out.println("7.ANTV========");  
      break;  
      case 8:  
      System.out.println("8. TV ONE=====");  
      break;  
      case 9:  
      System.out.println("9. NET TV=====");  
      break;  
      case 10:  
      System.out .println("10.KOMPAS TV==");  
      break;  
     }   
     System.out.println("================Selamat Manyaksikan==============");    System.out.println("Menu:");   
     System.out.println("1. ON/OFF");    
     System.out.println("2. Maximal Volume");    
     System.out.println("3. Minimal Volume");    
     System.out.println("4. Channel (+)");    
     System.out.println("5. Channel (-)");    
     System.out.println("6. Choose Channel");    
     System.out.println("7. Exit\n");   
     System.out.println("Masukkan pilihan > ");    
     menu = sc.nextInt();    
     switch(menu)   
     {   
      case 1:   
      Rmt.StatusTV(Rmt.status); break; //change TV status   
      case 2:   
      Rmt.VolumeTV(1); break; //add TV volume   
      case 3:   
      Rmt.VolumeTV(0); break; //less TV volume   
      case 4:   
      Rmt.ChannelTV(1); break; //change TV channel   
      case 5:   
      Rmt.ChannelTV(0); break;   
      case 6:   
      System.out.println("Masukkan nomor channel (1-10) > ");    
      pilihan = sc.nextInt();   
      if(Rmt.status==false) //check the TV status   
      {   
       System.out.println("Nyalakan TV dahulu");   
      }   
      else   
      {   
       if(pilihan<1 || pilihan>10)   
       {   
        System.out.println("Channel tidak tersedia");   
       }   
       else   
       {   
        Rmt.channel=pilihan; //change to random channel   
       }   
      }   
      break;   
      case 7:   
      break;   
     }   
     if(menu==7)   
     {   
      break;   
     }   
    }   
   }   
  }   


Hasil:

  • Tampilan Awal
  • Ketika TV sudah menyala
  • Ketika volume dinaikkan
  • Ketika Channel TV diganti

Rabu, 19 September 2018

TUGAS PWEB C (Tugas Kelas 2)

Belajar Membuat Layout dengan Menggunakan HTML dan CSS



Berikut adalah source code HTML (di simpan dengan nama file index.html)

 <!DOCTYPE html>  
 <html>  
 <head>  
   <title>Belajar Membuat Layout dengan HTML dan CSS</title>  
   <link rel="stylesheet" href="index.css"/>  
 </head>  
 <body>  
   <div class="header">  
     <div class="jarak">  
       <h2>Belajar membuat layout dengan HTML dan CSS</h2>  
     </div>  
   </div>  
 <div class="menu">  
   <ul>  
     <Li><a href="#">Home</a></Li>  
     <Li><a href="#">About</a></Li>  
     <Li><a href="#">Blog</a></Li>  
     <Li><a href="#">Contact</a></Li>  
   </ul>  
 </div>  
  <div class="content">  
  <div class="jarak">  
   <!-- kiri -->  
   <div class="kiri">  
   <!-- blog -->  
   <div class="border">  
   <div class="jarak">  
   <h3>Lorem Ipsum</h3>  
   <p>Lorem Ipsum is simply dummy tect for printing and typesetting industry. Lorem Ipsum has been...</p>  
   <button class="btn"> Read More .. </button>  
   </div>  
  </div>  
  <!-- end blog-->  
  <!-- blog-->  
  <div class="border">  
  <div class="jarak">  
   <h3> Lorem Ipsum</h3>  
   <p>Lorem Ipsum is simply dummy text of the printing and typesetting Industry. Lorem Ipsum has been...</p>  
   <button class="btn">Read More..</button>  
  </div>  
  </div>  
  <!--end blog-->  
  </div>  
  <!-- kiri-->  
  <!-- kanan-->  
  <div class="kanan">  
  <div class="jarak">  
    <h3> CATEGORY</h3>  
   <hr/>  
   <p><a href="a" class="undercor">HTML</a></p>  
   <p><a href="a" class="undercor">CSS</a></p>  
   <p><a href="a" class="undercor">BOOTSTRAP</a></p>  
   <p><a href="a" class="undercor">PHP</a></p>  
   <p><a href="a" class="undercor">MYSQL</a></p>  
   <p><a href="a" class="undercor">Jquery</a></p>  
   <p><a href="a" class="undercor">Ajax</a></p>  
   </div>  
  </div>  
  <!--kanan-->  
  </div>  
  </div>  
   <div class="footer">  
   <div class="jarak">  
   <p>copyright 2018 belajarbersama all reserved</p>  
  </div>  
  </div>  
 </body>  
 </html>  



Berikut adalah source code CSS (disimpan dengan nama file index.css)

 body  
 {  
   background:#f3f3f3;  
   color:#333;  
   width:100%;  
   font-family:sans-serif;  
   margin:0 auto;  
 }  
 header  
 {  
   width:90%;  
   margin:auto;  
   height:auto;  
   height:12px;  
   line-height:120px;  
   background:#41A85F;  
   color:#fff;  
 }  
 .contect  
 {  
   width:90%;  
   margin:auto;  
   height:420px;  
   padding:0.1px;  
   background:#fff;  
   color:#333;  
 }  
 .kiri  
 {  
   width:70%;  
   float:left;  
   margin:auto;  
   background:#fff;  
   height:420px;  
 }  
 .kanan  
 {  
   width:30%;  
   float:left;  
   margin:auto;  
   background:#fff;  
   height:420px;  
 }  
 .border  
 {  
   border:2px solid #74C599;  
   margin-top:1pc;  
   padding-bottom:1pc;  
   padding-left:2pc;  
   padding-right:2pc;  
 }  
 .undercor  
 {  
   text-decoration:none;  
 }  
  .footer  
  {   
    width:90%   
    margin:auto;   
    height:40px;   
    line-height:40px;   
    background:#41A8SF;   
    color:#fff;   
  }   
  .menu  
  {   
    background-color : #53bd84;   
    height:50px;   
    line-height:50px;   
    position:relative;   
    width:90%;   
    margin:0 auto;   
    padding:0 auto;   
  }   
  .jarak  
  {   
    padding:0 2pc;   
  }  
  .menu ul  
 {   
    list-style:none;   
 }   
  .menu ul li a  
  {   
    float:left;   
    width:70px;   
    display:block;   
    text-align:center;   
    color:#FFF;   
    text-decoration:none;   
  }  
  .menu ul li a:hover   
  {   
    background-color:#74C599;   
    display:block;   
  }   



Screenshot hasilnya :




Senin, 17 September 2018

Tugas PBO B (Tugas Kelas 3)

Membuat Program Ticket Machine

Source Code:
  • Ticketing
 /**  
  * Code for ticketing  
  *  
  * @author (Christine Amelia)  
  * @version (5-17/09/2018)  
  */  
 import java.util.Scanner;  
 public class Ticketing  
 {   
  //menyimpan harga  
  private int harga;    
  //menghitung uang setelah ditambah atau dikurang.    
  private int balance;    
  //total.    
  private int total;    
  //menginputkan harga   
  public Ticketing(int HargaTiket)    
  {    
  harga = HargaTiket;   
  balance = 0;    
  total = 0;    
  }    
  //melihat harga  
  public int getharga()    
  {    
  return harga;    
  }    
  //melihat hasil setelah ditambah atau dikurang  
  public int getBalance()    
  {    
   return balance;    
  }    
  //menginsertkan uang sipembeli  
  public void insertMoney(int amount)    
  {    
   balance = balance + amount;    
  }    
  /**    
  * Print a ticket.    
  * Update the total collected and    
  * reduce the balance to zero.    
  */    
  public void printTicket()    
  {    
   System.out.println("------Train Express------");    
   System.out.println("----------Ticket---------");    
   System.out.println("-------"+harga+ " Rupiah-------");   
   System.out.println("--------Safe Ride--------");    
   total = total + balance;    
   // mengembalikan jadi 0.    
   balance = 0;    
  }    
  }   


  • Main
 /**  
  * Code for the main system of ticketing  
  *  
  * @author (Christine Amelia)  
  * @version (4-17/09/2018)  
  */  
 import java.util.Scanner;  
 public class MainSystem  
 {    
   public static void main(String args[])    
  {    
    Scanner scan= new Scanner(System.in);    
    int cost,menu;    
    System.out.println("Insert the price of the ticket: \n");    
    cost=scan.nextInt();    
    Ticketing ticket=new Ticketing(cost);   
    System.out.println("1. Get Price");    
    System.out.println("2. Get Balance");    
    System.out.println("3. Insert Money");    
    System.out.println("4. Print Ticket");    
    System.out.println("5. Exit");   
    int x=1;   
    while(x == 1){   
      menu = scan.nextInt();   
      switch(menu)    
      {    
        case 1:    
        cost=ticket.getharga();    
        System.out.println(cost);    
        break;    
        case 2:    
        System.out.print(ticket.getBalance()+"\n");    
        break;    
        case 3:    
        int money=scan.nextInt();    
        ticket.insertMoney(money);    
        break;    
        case 4:    
        cost = ticket.getharga();    
        ticket.printTicket();    
        break;    
        case 5:   
         x=0;break;   
       }    
     }   
   }   
  }   


Minggu, 16 September 2018

Tugas PBO B (Tugas Rumah 2)

Membuat Pemandangan



  •  Canvas
 /**  
  * Canvas is a class that used to draw a simple graphics.  
  *  
  * @author (Christine Amelia)  
  * @version (4-16/08/2018)  
  */  
  import javax.swing.*;   
  import java.awt.*;   
  import java.util.List;   
  import java.util.*;   
  public class Canvas   
  {   
   private static Canvas canvasSingleton;   
   //get the canvas singleton object  
   public static Canvas getCanvas()   
   {   
    if(canvasSingleton == null) {   
     canvasSingleton = new Canvas("BlueJ Shapes Demo", 300, 300,    
            Color.white);   
    }   
    canvasSingleton.setVisible(true);   
    return canvasSingleton;   
   }  
   // ----- instance part -----   
   private JFrame frame;   
   private CanvasPane canvas;   
   private Graphics2D graphic;   
   private Color backgroundColor;   
   private Image canvasImage;   
   private List<Object> objects;   
   private HashMap<Object, ShapeDescription> shapes;   
   /**  
   *title that appear in Canvas frame  
   *width that we want for the canvas  
   *height that we want for the canvas  
   *bgColor for the background color that we want for the canvas  
   */  
   private Canvas(String title, int height, int width, Color bgColor)   
   {   
    frame = new JFrame();   
    canvas = new CanvasPane();   
    frame.setContentPane(canvas);   
    frame.setTitle(title);   
    canvas.setPreferredSize(new Dimension(width, height));   
    backgroundColor = bgColor;   
    frame.pack();   
    objects = new ArrayList<Object>();   
    shapes = new HashMap<Object, ShapeDescription>();   
   }   
   public void setVisible(boolean visible)   
   {   
    if(graphic == null)   
    {    
     Dimension size = canvas.getSize();   
     canvasImage = canvas.createImage(size.width, size.height);   
     graphic = (Graphics2D)canvasImage.getGraphics();   
     graphic.setColor(backgroundColor);   
     graphic.fillRect(0, 0, size.width, size.height);   
     graphic.setColor(Color.black);   
    }   
    frame.setVisible(visible);   
   }   
   public void draw(Object referenceObject, String color, Shape shape)   
   {   
    objects.remove(referenceObject);    
    objects.add(referenceObject);     
    shapes.put(referenceObject, new ShapeDescription(shape, color));   
    redraw();   
   }   
   public void erase(Object referenceObject)   
   {   
    objects.remove(referenceObject);    
    shapes.remove(referenceObject);   
    redraw();   
   }   
   //Set the foreground color of the Canvas.  
   public void setForegroundColor(String colorString)   
   {   
    if(colorString.equals("red")) {   
     graphic.setColor(Color.red);   
    }   
    else if(colorString.equals("black")) {   
     graphic.setColor(Color.black);   
    }   
    else if(colorString.equals("blue")) {   
     graphic.setColor(Color.blue);   
    }   
    else if(colorString.equals("yellow")) {   
     graphic.setColor(Color.yellow);   
    }   
    else if(colorString.equals("green")) {   
     graphic.setColor(Color.green);   
    }   
    else if(colorString.equals("magenta")) {   
     graphic.setColor(Color.magenta);   
    }   
    else if(colorString.equals("white")) {   
     graphic.setColor(Color.white);   
    }   
    else {   
     graphic.setColor(Color.black);   
    }   
   }   
   //Wait for a specified number of milliseconds before finishing.   
   public void wait(int milliseconds)   
   {   
    try   
    {   
     Thread.sleep(milliseconds);   
    }    
    catch (Exception e)   
    {   
     // ignoring exception at the moment   
    }   
   }   
   //Redraw ell shapes currently on the Canvas.    
   private void redraw()   
   {   
    erase();   
    for(Object shape : objects) {   
     shapes.get(shape).draw(graphic);   
    }   
    canvas.repaint();   
   }   
   //Erase the whole canvas. (Does not repaint.)   
   private void erase()   
   {   
    Color original = graphic.getColor();   
    graphic.setColor(backgroundColor);   
    Dimension size = canvas.getSize();   
    graphic.fill(new Rectangle(0, 0, size.width, size.height));   
    graphic.setColor(original);   
   }   
   private class CanvasPane extends JPanel   
   {   
    public void paint(Graphics g)   
    {   
     g.drawImage(canvasImage, 0, 0, null);   
    }   
   }   
   private class ShapeDescription   
   {   
    private Shape shape;   
    private String colorString;   
    public ShapeDescription(Shape shape, String color)   
    {   
     this.shape = shape;   
     colorString = color;   
    }   
    public void draw(Graphics2D graphic)   
    {   
     setForegroundColor(colorString);   
     graphic.fill(shape);   
    }   
   }   
  }   

  • Circle
 /**  
  * Write a description of class circle here.  
  *  
  * @author (Christine Amelia)  
  * @version (4-16/09/2018)  
  */  
  import java.awt.*;   
  import java.awt.geom.*;    
  public class Circle   
  {   
   private int diameter;   
   private int xPosition;   
   private int yPosition;   
   private String color;   
   private boolean isVisible;   
   //Create a new circle at default position with default color   
   public Circle()   
   {   
    diameter = 30;   
    xPosition = 0;   
    yPosition = 0;   
    color = "blue";   
    isVisible = false;   
   }   
   //Make this circle visible. If it was already visible, do nothing   
   public void makeVisible()   
   {   
    isVisible = true;   
    draw();   
   }   
   //Make this circle invisible. If it was already invisible, do nothing   
   public void makeInvisible()   
   {   
    erase();   
    isVisible = false;   
   }   
   //Move the circle to the right  
   public void moveRight()   
   {   
    moveHorizontal(20);   
   }   
   //Move the circle to the left  
   public void moveLeft()   
   {   
    moveHorizontal(-20);   
   }   
   //Move the circle up   
   public void moveUp()   
   {   
    moveVertical(-20);   
   }   
   //Move the circle down  
   public void moveDown()   
   {   
    moveVertical(20);   
   }   
   //Move the circle horizontally by 'distance' pixels   
   public void moveHorizontal(int distance)   
   {   
    erase();   
    xPosition += distance;   
    draw();   
   }   
   //Move the circle vertically by 'distance' pixels   
   public void moveVertical(int distance)   
   {   
    erase();   
    yPosition += distance;   
    draw();   
   }   
   //Slowly move the circle horizontally by 'distance' pixels   
   public void slowMoveHorizontal(int distance)   
   {   
    int delta;   
    if(distance < 0)    
    {   
     delta = -1;   
     distance = -distance;   
    }   
    else    
    {   
     delta = 1;   
    }   
    for(int i = 0; i < distance; i++)   
    {   
     xPosition += delta;   
     draw();   
    }   
   }   
   //Slowly move the circle vertically by 'distance' pixels   
   public void slowMoveVertical(int distance)   
   {   
    int delta;   
    if(distance < 0)    
    {   
     delta = -1;   
     distance = -distance;   
    }   
    else    
    {   
     delta = 1;   
    }   
    for(int i = 0; i < distance; i++)   
    {   
     yPosition += delta;   
     draw();   
    }   
   }   
   //Change the size to the new size (in pixels)   
   public void changeSize(int newDiameter)   
   {   
    erase();   
    diameter = newDiameter;   
    draw();   
   }   
   //Change the color. Valid colors are "red", "yellow", "blue", "green","magenta" and "black".   
   public void changeColor(String newColor)   
   {   
    color = newColor;   
    draw();   
   }   
   //Draw the circle with current specifications on screen   
   private void draw()   
   {   
    if(isVisible) {   
     Canvas canvas = Canvas.getCanvas();   
     canvas.draw(this, color, new Ellipse2D.Double(xPosition, yPosition,    
                diameter, diameter));   
     canvas.wait(10);   
    }   
   }   
   //Erase the circle on screen   
   private void erase()   
   {   
    if(isVisible) {   
     Canvas canvas = Canvas.getCanvas();   
     canvas.erase(this);   
    }   
   }   
  }   


  • Triangle
 /**  
  * A triangle that can be manipulated and draws itself on the canvas  
  *  
  * @author (Chrsitine Amelia)  
  * @version (4-16/09/2018)  
  */  
 import java.awt.*;    
  public class Triangle   
  {   
   private int height;   
   private int width;   
   private int xPosition;   
   private int yPosition;   
   private String color;   
   private boolean isVisible;   
   //Create a new triangle at default position with default color  
   public Triangle()   
   {   
    height = 40;   
    width = 50;   
    xPosition = 0;   
    yPosition = 0;   
    color = "green";   
    isVisible = false;   
   }   
   //Make this triangle visible. If it was already visible, do nothing   
   public void makeVisible()   
   {   
    isVisible = true;   
    draw();   
   }   
   //Make this triangle invisible. If it was already invisible, do nothing   
   public void makeInvisible()   
   {   
    erase();   
    isVisible = false;   
   }   
   //Move the triangle to the right   
   public void moveRight()   
   {   
    moveHorizontal(20);   
   }   
   //Move the triangle to the left  
   public void moveLeft()   
   {   
    moveHorizontal(-20);   
   }   
   //Move the triangle up.    
   public void moveUp()   
   {   
    moveVertical(-20);   
   }   
   //Move the triangle a few pixels down  
   public void moveDown()   
   {   
    moveVertical(20);   
   }   
   //Move the triangle horizontally by 'distance' pixels   
   public void moveHorizontal(int distance)   
   {   
    erase();   
    xPosition += distance;   
    draw();   
   }   
   //Move the triangle vertically by 'distance' pixels   
   public void moveVertical(int distance)   
   {   
    erase();   
    yPosition += distance;   
    draw();   
   }   
   //Slowly move the triangle horizontally by 'distance' pixels   
   public void slowMoveHorizontal(int distance)   
   {   
    int delta;   
    if(distance < 0)    
    {   
     delta = -1;   
     distance = -distance;   
    }   
    else    
    {   
     delta = 1;   
    }   
    for(int i = 0; i < distance; i++)   
    {   
     xPosition += delta;   
     draw();   
    }   
   }   
   //Slowly move the triangle vertically by 'distance' pixels   
   public void slowMoveVertical(int distance)   
   {   
    int delta;   
    if(distance < 0)    
    {   
     delta = -1;   
     distance = -distance;   
    }   
    else    
    {   
     delta = 1;   
    }   
    for(int i = 0; i < distance; i++)   
    {   
     yPosition += delta;   
     draw();   
    }   
   }   
   //Change the size to the new size (in pixels)   
   public void changeSize(int newHeight, int newWidth)   
   {   
    erase();   
    height = newHeight;   
    width = newWidth;   
    draw();   
   }   
   //Change the color. Valid colors are "red", "yellow", "blue", "green","magenta" and "black"  
   public void changeColor(String newColor)   
   {   
    color = newColor;   
    draw();   
   }   
   //Draw the triangle with current specifications on screen   
   private void draw()   
   {   
    if(isVisible) {   
     Canvas canvas = Canvas.getCanvas();   
     int[] xpoints = { xPosition, xPosition + (width/2), xPosition - (width/2) };   
     int[] ypoints = { yPosition, yPosition + height, yPosition + height };   
     canvas.draw(this, color, new Polygon(xpoints, ypoints, 3));   
     canvas.wait(10);   
    }   
   }   
   //Erase the triangle on screen.    
   private void erase()   
   {   
    if(isVisible) {   
     Canvas canvas = Canvas.getCanvas();   
     canvas.erase(this);   
    }   
   }   
  }   


  • Picture
 /**  
  * My picture  
  *  
  * @author (Christine Amelia)  
  * @version (4-16/09/2018)  
  */  
  public class Picture   
  {   
   private Triangle gunung1, gunung2, jalan;   
   private Circle matahari, awan1, awan2, awan3, awan4, awan5, awan6;     
   public Picture()   
   {   
   }   
   public void draw()   
   {   
    matahari = new Circle();   
    matahari.changeSize(80);   
    matahari.moveHorizontal(20);   
    matahari.moveVertical(20);   
    matahari.changeColor("yellow");   
    matahari.makeVisible();   
    gunung1 = new Triangle();   
    gunung1.changeSize(100, 200);   
    gunung1.moveHorizontal(75);   
    gunung1.moveVertical(65);   
    gunung1.changeColor("green");   
    gunung1.makeVisible();   
    gunung2 = new Triangle();   
    gunung2.changeSize(100, 200);   
    gunung2.moveHorizontal(225);   
    gunung2.moveVertical(65);   
    gunung2.changeColor("green");   
    gunung2.makeVisible();    
    awan1 = new Circle();   
    awan1.changeSize(30);   
    awan1.moveHorizontal(80);   
    awan1.moveVertical(0);   
    awan1.changeColor("blue");   
    awan1.makeVisible();   
    awan2 = new Circle();   
    awan2.changeSize(30);   
    awan2.moveHorizontal(60);   
    awan2.moveVertical(10);   
    awan2.changeColor("blue");   
    awan2.makeVisible();   
    awan3 = new Circle();   
    awan3.changeSize(30);   
    awan3.moveHorizontal(80);   
    awan3.moveVertical(20);   
    awan3.changeColor("blue");   
    awan3.makeVisible();   
    awan4 = new Circle();   
    awan4.changeSize(30);   
    awan4.moveHorizontal(100);   
    awan4.moveVertical(20);   
    awan4.changeColor("blue");   
    awan4.makeVisible();   
    awan5 = new Circle();   
    awan5.changeSize(30);   
    awan5.moveHorizontal(100);   
    awan5.moveVertical(0);   
    awan5.changeColor("blue");   
    awan5.makeVisible();   
    awan6 = new Circle();   
    awan6.changeSize(30);   
    awan6.moveHorizontal(120);   
    awan6.moveVertical(10);   
    awan6.changeColor("blue");   
    awan6.makeVisible();   
   }   
  }   



  • Hasil Gambar:



Senin, 10 September 2018

Tugas PBO B (Tugas Kelas 2)

Berikut adalah program untuk mencari luas permukan dan volume bangum ruang.

Screenshot hasil




Source Code
1. Kubus
 /**  
  * Program mengitung luas permukaan dan volume  
  *  
  * @author (Christine Amelia)  
  * @version (3-09/10/2018)  
  */  
 public class Kubus  
 {  
   public double s;  
   //Methods to return luas permukaan dan volume  
   public double luas_permukaan(){  
     return 6*s*s;  
   }  
   public double volume(){  
     return s*s*s;  
   }  
 }  


2. Balok
 /**  
  * Program menghitung Luas Permukaan da Volume  
  *  
  * @author (Christine Amelia)  
  * @version (3-09/10/2018)  
  */  
 public class Balok  
 {  
   public double p,l,t;  
   //Methods to return Luas permukaan dan volume;  
   public double luas_permukaan(){  
     return 2*((p*l)+(p*t)+(l*t));  
   }  
   public double volume(){  
     return p*l*t;  
   }  
 }  


3.Tabung
 /**  
  * Program menghitung Luas Permukaan dan Volume  
  *  
  * @author (Christine Amelia)  
  * @version (3-09/10/2018)  
  */  
 public class Tabung  
 {  
   public double r,t;  
   //Methods to return Luas Permukaan dan Volume;  
   public double luas_permukaan(){  
     return 2*3.14*r*(r+t);  
   }  
   public double volume(){  
     return 3.14*r*r*t;  
   }  
 }  


4. Bola
 /**  
  * Program menghitung Luas Permukaan dan Volume  
  *  
  * @author (Christine Amelia)  
  * @version (3-09/10/2018)  
  */  
 public class Bola  
 {  
   public double r;  
   //Methods to return luas permukaan dan volume  
   public double luas_permukaan(){  
     return 4*3.14*r*r;  
   }  
   public double volume(){  
     return 4/3*3.14*r*r*r;  
   }  
 }  


5. MyMain
 /**  
  * Program menghitung Luas Permukaan dan Volume  
  *  
  * @author (Christine Amelia)  
  * @version (3-09/10/2018)  
  */  
 public class MyMain  
 {  
   public static void main(){  
     Kubus aKubus; //creating reference  
     aKubus = new Kubus(); //creating object  
     aKubus.s = 5; //assigning value to data field  
     double luas_permukaan1 = aKubus.luas_permukaan(); //invoking method  
     double volume1 = aKubus.volume();  
     System.out.println("Kubus");  
     System.out.println("Sisi= "+aKubus.s);  
     System.out.println("Luas Permukaan= "+luas_permukaan1);  
     System.out.println("Volume= "+volume1);  
     System.out.println("---------------------------------------------------");  
     Balok aBalok;  
     aBalok = new Balok();  
     aBalok.p = 3;  
     aBalok.l = 4;  
     aBalok.t = 5;  
     double luas_permukaan2 = aBalok.luas_permukaan();  
     double volume2 = aBalok.volume();  
     System.out.println("Balok");  
     System.out.println("Panjang="+aBalok.p+" Lebar="+aBalok.l+" Tinggi="+aBalok.t);  
     System.out.println("Luas Permukaan= "+luas_permukaan2);  
     System.out.println("Volume= "+volume2);  
     System.out.println("---------------------------------------------------");  
     Tabung aTabung;  
     aTabung = new Tabung();  
     aTabung.r = 14;  
     aTabung.t = 5;  
     double luas_permukaan3 = aTabung.luas_permukaan();  
     double volume3 = aTabung.volume();  
     System.out.println("Tabung");  
     System.out.println("Jari-jari="+aTabung.r+" Tinggi="+aTabung.t);  
     System.out.println("Luas Permukaan= "+luas_permukaan3);  
     System.out.println("Volume= "+volume3);  
     System.out.println("---------------------------------------------------");  
     Bola aBola;  
     aBola = new Bola();  
     aBola.r = 14;  
     double luas_permukaan4 = aBola.luas_permukaan();  
     double volume4 = aBola.volume();  
     System.out.println("Bola");  
     System.out.println("Jari-jari= "+aBola.r);  
     System.out.println("Luas Permukaan= "+luas_permukaan4);  
     System.out.println("Volume= "+volume4);  
   }  
 }  

Selasa, 04 September 2018

TUGAS PWEB (TUGAS 1)

Saya mencoba membuat CV sebagai tugas pertama dalam mata kuliah pemrograman berbasis web. Berikut hasilnya:




Source code:
 <html>  
 <head>  
 <title> Curriculum Vitae Christine Amelia </title>  
 <meta name="viewport" content="width=device-width, initial-scale=1">  
 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">  
 <style type="text/css">a {text-decoration: none}</style>  
 </head>  
 <body background="daun2.jpg">  
 <h1 align=center><font face="Courier" size=7>BIODATA</font></h1>  
 <hr style="background-color:#424242;" size=3></hr>  
 <table align="center">  
   <tr>  
        <td rowspan=9><img alt="Foto" src="Foto_amel.jpg" height="250px" width="200px"/></td>  
     <td style="background-color:#E6E6E6;">Nama</td>  
     <td>Christine Amelia</td>  
   </tr>  
   <tr>  
     <td style="background-color:#D8D8D8;">Tempat/Tanggal Lahir</td>  
     <td>Batam, 11 Maret 1999</td>  
   </tr>  
   <tr>  
     <td style="background-color:#BDBDBD;">Jenis Kelamin</td>  
     <td>Perempuan</td>  
   </tr>  
   <tr>  
     <td style="background-color:#A4A4A4;">Alamat</td>  
     <td>Jl. Keputih Tegal Timur II No. 19a, Keputih, Sukolilo Surabaya</td>  
   </tr>  
   <tr>  
     <td style="background-color:#848484;">Nomor Telepon</td>  
     <td>082172874560</td>  
   </tr>  
     <tr>  
     <td style="background-color:#6E6E6E;">Website</td>  
     <td><a href="https://chrstnamelia.blogspot.com/">chrstnamelia.blogspot.com</a></td>  
   </tr>  
   <tr>  
     <td style="background-color:#585858;">Email</td>  
     <td>christineamel03@gmail.com</td>  
   </tr>  
 </table>  
 <h1 align=center><font face="Courier" size=7>RIWAYAT PENDIDIKAN</font></h1>  
 <hr style="background-color:#424242;" size=3></hr>  
 <table align="center">  
      <tr style="background-color:#A4A4A4;"align="center">  
        <td>Jenjang</td>  
     <td>Nama Sekolah</td>  
     <td>Tahun</td>  
   </tr>  
   <tr align="center">  
     <td>SD</td>  
     <td>SDS MAITREYAWIRA BATAM</td>  
     <td>2005-2011  
   </tr>  
   <tr align="center">  
     <td>SMP</td>  
     <td>SMPN 3 BATAM</td>  
     <td>2011-2014  
   </tr>  
   <tr align="center">  
     <td>SMA</td>  
     <td>SMAK YOS SUDARSO BATAM</td>  
     <td>2014-2017</td>  
   </tr>  
   <tr align="center">  
     <td>Perguruan Tinggi</td>  
     <td>Teknik Informatika, ITS</td>  
     <td>2017-Sekarang</td>  
   </tr>  
 </table>  
 <h1 align=center><font face="Courier" size=7>Riwayat Organisasi</font></h1>  
 <hr style="background-color:#424242;" size=3>  
 </h1>  
 <table align="center">  
      <tr style="background-color:#A4A4A4;" align="center">  
     <td>Event</td>  
     <td>Tahun</td>  
   </tr>  
   <tr align="center">  
     <td align="center">YOS CUP</td>  
     <td>2016  
   </tr>  
   <tr align="center">  
     <td>Schematics ITS</td>  
     <td>2018</td>  
   </tr>  
 </table>  
 <p>Find me on:<br>  
 <i style="font-size:20px" class="fa">&#xf082 <a target="_blank" rel="noopener noreferrer" href="https://www.facebook.com/profile.php?id=100008281422931">Christine Amelia</a></i><br>  
 <i style="font-size:20px" class="fa">&#xf081 <a target="_blank" rel="noopener noreferrer" href="https://twitter.com/tineamels?s=09">@tineamels</a></i>  
 </br>  
 </p>  
 </body>  
 </html>       



Minggu, 02 September 2018

TUGAS PBO B (TUGAS 1)

Tugas pertama kelas PBO B hari ini adalah membuat data diri dengan Java menggunakan BlueJ.
Berikut ini adalah hasil compilenya:
Berikut adalah source codenya:


 /**  
  * Tugas 1  
  *  
  * @author (Christine Amelia)  
  * @version (2-09/03/2018)  
  */  
 public class Tugas1  
 {  
   // instance variables - replace the example below with your own  
   private int x;  
   /**  
    * Constructor for objects of class Tugas1  
    */  
   public Tugas1()  
   {  
     // initialise instance variables  
     x = 0;  
     System.out.println("Tugas 1 PBO B");  
     System.out.println("BIODATA");  
     System.out.println("Nama    : Christine Amelia");  
     System.out.println("Kelas    : PBO B");  
     System.out.println("Alamat   : Jl. Keputih Tegal Timur II No. 19a");  
     System.out.println("Email    : christineamel03@gmail.com");  
     System.out.println("No. HP/WA  : 082172874560");  
     System.out.println("Twitter   : @tineamels");  
   }  
   /**  
    * 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;  
   }  
 }

MPPL 2020 - Manajemen Biaya

Christine Amelia / 05111740000174 Nandha Himawan / 05111740000180 Berikut merupakan manajemen biaya yang telah kami buat berdasarkan KAK ...