Minggu, 30 September 2018

TUGAS PBO B

MEMBUAT SEBUAH JAM DIGITAL

Pada jurnal kali ini, saya diberikan tugas untuk Membuat display sebuah jam digital menggunakan java. Setelah melakukan proses-proses untuk mengidentifikasi hal-hal yang dibutuhkan untuk Membuat jam, maka dapat dibuat program dan muncul display berikut :


Kelas yang digunakan :
Source Code :

TestClockDisplay

  import java.awt.*;   
  import java.awt.event.*;   
  import javax.swing.*;   
  import javax.swing.border.*;   
  import java.util.Scanner;   
  /**   
  * Digital Clock   
  *   
  * @author CarWima  
  * @version 1.0Beta   
  */    
  public class TestClockDisplay  
  {   
   Scanner sc = new Scanner(System.in);   
   private JFrame frame;   
   private JLabel label;   
   private ClockDisplay clock;   
   private boolean clockRunning = false;   
   private TimerThread timerThread;   
   public TestClockDisplay()   
   {   
    makeFrame();   
    clock = new ClockDisplay();   
   }   
   private void start()   
   {   
    clockRunning = true;   
    timerThread = new TimerThread();   
    timerThread.start();   
   }   
   private void stop()   
   {   
    clockRunning = false;   
   }   
   private void stepMinute()   
   {   
    clock.timeTickMinute();   
    label.setText(clock.getTime());   
   }   
   private void stepHour()   
   {   
    clock.timeTickHour();   
    label.setText(clock.getTime());   
   }   
   private void showAbout()   
   {   
    JOptionPane.showMessageDialog (frame,    
     "Digital Clock\n",    
     "About Clock",   
     JOptionPane.INFORMATION_MESSAGE);   
   }   
   private void quit()   
   {   
    System.exit(0);   
   }   
   private void makeFrame()   
   {   
    frame = new JFrame("Clock");   
    JPanel contentPane = (JPanel)frame.getContentPane();   
    contentPane.setBorder(new EmptyBorder(1, 50, 1, 50));   
    makeMenuBar(frame);   
    contentPane.setLayout(new BorderLayout(12,12));   
    label = new JLabel("00:00", SwingConstants.CENTER);   
    Font displayFont = label.getFont().deriveFont(96.0f);   
    label.setFont(displayFont);   
    contentPane.add(label,BorderLayout.CENTER);   
    JPanel toolbar = new JPanel();   
    toolbar.setLayout(new GridLayout(1,0));   
    JButton startButton = new JButton("START");   
    startButton.addActionListener(e -> start());   
    toolbar.add(startButton);   
    JButton stopButton = new JButton("STOP");   
    stopButton.addActionListener(e -> stop());   
    toolbar.add(stopButton);   
    JButton setButtonH = new JButton("STEP-HOUR");   
    setButtonH.addActionListener(e -> stepHour());   
    toolbar.add(setButtonH);   
    JPanel flow = new JPanel();   
    flow.add(toolbar);   
    contentPane.add(flow, BorderLayout.SOUTH);   
    frame.pack();   
    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();   
    frame.setLocation(d.width/2 - frame.getWidth()/2, d.height/2 - frame.getHeight()/2);   
    frame.setVisible(true);   
   }   
   private void makeMenuBar(JFrame frame)   
   {   
    final int SHORTCUT_MASK =   
    Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();   
    JMenuBar menubar = new JMenuBar();   
    frame.setJMenuBar(menubar);   
    JMenu menu;   
    JMenuItem item;   
    menu = new JMenu("File");   
    menubar.add(menu);   
    item = new JMenuItem("About Clock...");   
    item.addActionListener(e -> showAbout());   
    menu.add(item);   
    menu.addSeparator();   
    item = new JMenuItem("Quit");   
    item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, SHORTCUT_MASK));   
    item.addActionListener(e -> quit());   
    menu.add(item);   
   }   
   class TimerThread extends Thread   
   {   
    public void run()   
    {   
     while (clockRunning) {   
      stepMinute();   
      pause();   
     }   
    }   
    private void pause()   
    {   
     try {   
      Thread.sleep(60000);   
     }   
     catch (InterruptedException exc) {   
     }   
    }   
   }   
  }   

ClockDisplay

 public class ClockDisplay   
  {   
   private NumberDisplay hours;   
   private NumberDisplay minutes;   
   private String displayString;   
   /**   
    * new clock set at 00:00.   
   */   
   public ClockDisplay()   
   {   
    hours = new NumberDisplay(24);   
    minutes = new NumberDisplay(60);   
    updateDisplay();   
   }   
   public ClockDisplay(int hour, int minute)   
   {   
    hours = new NumberDisplay(24);   
    minutes = new NumberDisplay(60);   
    setTime(hour, minute);   
   }   
   public void timeTickMinute()   
   {   
    minutes.increment();   
    if(minutes.getValue() == 0) {   
     hours.increment();   
    }   
    updateDisplay();   
   }   
   public void timeTickHour()   
   {   
    hours.increment();   
    updateDisplay();   
   }   
   public void setTime(int hour, int minute)   
   {   
    hours.setValue(hour);   
    minutes.setValue(minute);   
    updateDisplay();   
   }   
   public String getTime()   
   {   
    return displayString;   
   }   
   private void updateDisplay()   
   {   
    displayString = hours.getDisplayValue() + ":" +   
    minutes.getDisplayValue();   
   }   
  }   

NumberDisplay
 public class NumberDisplay   
  {   
   private int limit;   
   private int value;   
   public NumberDisplay(int rollOverLimit)   
   {   
    limit = rollOverLimit;   
    value = 0;   
   }   
   public int getValue()   
   {   
    return value;   
   }   
   public String getDisplayValue()   
   {   
    if(value < 10) {   
     return "0" + value;   
    }   
    else {   
     return "" + value;   
    }   
   }   
   public void setValue(int replacementValue)   
   {   
    if((replacementValue >= 0) && (replacementValue < limit)) {   
     value = replacementValue;   
    }   
   }   
   public void increment()   
   {    
    value = (value + 1) % limit;   
   }   
  }   

Selasa, 25 September 2018

Tugas PWEB C

Membuat laman berita pada CSS

Pada Jurnal kali ini, saya ingin menampilkan tugas saya mengenai pembuatan sebuah tampilan berita.



HTML
 <!DOCTYPE html>  
 <html>  
 <head>  
  <title>Enlightechnology</title>  
  <link rel="stylesheet" href="Custom.css"/>  
  <meta charset="UTF-8">  
 </head>  
 <body>  
  <div class="header">  
   <div class="container">  
    <h2>Enlightechnology</h2>  
    <h4>News</h4>     
   </div>  
  </div>  
  <div class="menu">  
   <ul>  
    <li><a href="#home">Home</a></li>  
    <li><a href="#about">Tech</a></li>  
    <li><a href="#about">Education</a></li>  
   </ul>   
  </div>  
  <div class="content">  
   <div class="container">  
    <div class="post">  
     <div class="container border">  
      <div class="prev">  
       <img src="1.jpg">  
      </div>  
      <div class="prev">  
       <h3>Tak Ingin ketinggalan, Nokia Siapkan Smartphone Gaming</h3>  
       <h6>Reza Hendrawan - Sep 19, 2018</h6>  
       <p>Beberapa vendor smartphone Android saat ini sudah terjun ke segme smartphone gaming, dan kedepannya bakal semakin banyak produsen yang bersaing dala segmen tersebut. Sebelumnya...</p>  
       <button class="btn">Read More</button>  
      </div>  
     </div>  
     <div class="container border">  
      <div class="prev">  
       <img src="2.jpg">  
      </div>  
      <div class="prev">  
       <h3>Meski Belum Dirilis, Video Hands-On Xiaomi Redmi Note 6 Pro Telah Muncul</h3>  
       <h6>Reza Hendrawan - Sep 18, 2018 </h6>  
       <p>Sebelumnya telah muncul bocoran foto yang memperlihatkan kotak penjualan Xiaomi Redmi Note 6 Pro yang memberikan beberapa informasi mengenai spesifikasi yang diusung oleh smartphone...</p>  
       <button class="btn">Read More</button>  
      </div>  
     </div>  
    </div>  
    <div class="category">  
     <div class="container">  
      <h3>Fokus</h3>  
      <hr/>  
      <p><a href="#" class="undecor">Handphone Bootloop? Begini solusinya</a></p>  
      <p><a href="#" class="undecor">Inilah kelebihan MIUI 10</a></p>  
      <p><a href="#" class="undecor">Teknologi IPHONE</a></p>  
     </div>  
    </div>  
   </div>  
  </div>  
  <div class="footer">  
   <div class="container">  
    <p>©2018 CARWIMA</p>  
   </div>   
  </div>  
 </body>  
 </html>  

CSS
 body {  
  background:#fff;  
  color:#333;  
  width:100%;  
  font-family:sans-serif;  
  margin:0 auto;  
 }  
 .header {  
  width:90%;  
  margin: 2em auto 0;  
  height:140px;  
  background: #00daff;  
  color:#fff;  
 }  
 .content {  
  border:2px solid #00daff;  
  width:90%;  
  margin:auto;  
  height:1200px;  
  padding:0.1px;  
  background:#fff;  
  color:#333;  
 }  
 .post {  
  width:70%;  
  float:left;  
  margin:auto;  
  background:#fff;  
  height:420px;  
 }  
 .category {  
  width:30%;  
  float:left;  
  margin:auto;  
  background:#fff;  
  height:420px;  
 }  
 .border {  
  border:2px solid #00daff;  
  margin-top:1em;  
  padding-bottom:1em;  
  padding-left:2em;  
  padding-right:2em;  
 }  
 .undecor {  
  text-decoration:none;  
 }  
 .footer {  
  width:90%;  
  margin: 0 auto;  
  background:#00daff;  
  color:#fff;  
 }  
 .menu {  
  background-color: #00daff;   
  height:40px;   
  line-height:40px;   
  position:relative;  
  width:90%;  
  margin:0 auto;  
  padding:0 auto;  
 }  
 .container {  
  padding:1.5em;  
 }  
 .footer .container {  
  margin-left: 1.8em;  
  padding: 0.2em;  
 }  
 .menu ul {  
  margin: auto 0;  
  list-style:none;  
  padding-left: 1em;  
 }  
 .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:#00b1ce;   
  display:block;  
 }  
 h4 {  
   font-style: italic;  
 }  
 .prev {  
   display: inline-block;  
   max-width: 450px;  
   margin: 0 1em;  
   text-align: justify;  
 }  

Minggu, 23 September 2018

TUGAS PBOB - Membuat Program Remote TV

Membuat Program Remote TV Pada Blue J

Pada jurnal perkuliahan kali ini, saya ingin menjelaskan sedikit mengenai tugas saya yaitu membuat program remote tv pada blueJ. Mengingat mekanisme TV, terdapat 2 hal yang paling dibutuhkan, yakni volume dan channel.

Pertama, Volume TV pada awal dinyalakan diset 50 dan Channelnya 1.

Ini adalah Meni volume up dan volume down, berguna untuk menambah/mengurangi volume.

Mengikuti sistem channel tv yang dinamis, dikarenakan rentang channel hanya1-15, ketika channel ditambah pada kondisi max, maka akan kembali ke awal. Sebaliknya jika pada kondisi minimum dan dikurangi.

Mengakhiri Program.

Bentuk relasi class RemoteTv dann Main.

Main
  /**   
  * Program Remote TV   
  * @author Carlo Win Marshal   
  * Version 1.00 Beta   
  */   
  import java.util.Scanner;   
  public class Main   
  {   
   public static void Main()   
   {   
    Scanner sc = new Scanner(System.in);   
    int menu, vol, ch;   
    menu=0;  
    vol = 50;   
    ch = 1;  
    RemoteTv tombol = new RemoteTv();  
    while(menu!=8)   
    {   
    System.out.println("TV Remote");   
    System.out.println("1 Get Channel");   
    System.out.println("2 Get Volume");   
    System.out.println("3 Volume Up");   
    System.out.println("4 Volume Down");   
    System.out.println("5 Channel up");   
    System.out.println("6 Channel down");  
    System.out.println("7 Info");  
    System.out.println("8 Turn off");  
    menu = sc.nextInt();   
    switch(menu)   
    {   
     case 1:   
     ch=tombol.getChannel();   
     System.out.println("Anda berada pada channel "+ch);   
     break;   
     case 2:   
     vol=tombol.getVolume();   
     System.out.println("Volume sekarang "+vol);   
     break;   
     case 3:   
     tombol.upVolume();  
     vol = tombol.getVolume();  
     System.out.println("Volume dinaikkan, volume sekarang "+vol);   
     break;   
     case 4:   
     tombol.downVolume();  
     vol = tombol.getVolume();  
     System.out.println("Volume diturunkan, volume sekarang "+vol);   
     break;   
     case 5:   
     tombol.upChannel();  
     ch = tombol.getChannel();  
     System.out.println("Anda berada pada channel "+ch);   
     break;   
     case 6:   
     tombol.downChannel();   
     ch = tombol.getChannel();  
     System.out.println("Anda berada pada channel "+ch);   
     break;  
     case 7:  
     System.out.println("==== Volume awal = 50 ====");  
     System.out.println("==== Channel awal = 1 ====");  
     System.out.println("==== Max/Min Volume = 100/1 ====");  
     System.out.println("==== Max/Min Channel = 15 ====");  
     break;  
     case 8:  
     System.out.println("***** Turned Off *****");  
     break;  
    }   
   }   
   }   
  }   

RemoteTv
  public class RemoteTv   
  {   
   public int balance;   
   private int channel;   
   private int volume;   
   public RemoteTv()   
   {   
    channel = 1;   
    volume = 50;   
   }  
   public int getChannel()   
   {   
    return channel;   
   }   
   public int getVolume()   
   {   
    return volume;  
   }   
   public void downVolume()  
   {  
   if (volume>1)volume = volume-1;  
   }  
   public void upVolume()  
   {  
   if (volume<100) volume = volume+1;  
   }  
   public void upChannel()  
   {  
   if (channel==15) channel=1;  
   else channel = channel+1;  
   }  
   public void downChannel()  
   {  
   if(channel==1) channel=15;   
   else channel=channel-1;  
   }  
 }  

Selasa, 18 September 2018

PWEB C

Membuat sebuah web sederhana

Membuat sebuah web sederhana dengan css dan html.

Index.html
 <!DOCTYPE html>  
 <html>  
 <head>  
 <title> Belajar Membuat Layout dengan HTML dan CSS </title>  
      <link rel="stylesheet" type="text/css" href="Custom.css">  
      <meta charset="utf-8">  
      <meta name="viewport" content="width=device-width, initial-scale=1">  
 </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">  
            <div class="kiri">  
                <div class="border">  
                     <div class="jarak">  
                      <h3> Lore Ipsum</h3>  
                      <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip </p>  
                      <button class="btn"> Read More..</button>  
                     </div>  
                 </div>  
                <div class="border">  
                     <div class="jarak">  
                      <h3> Lore Ipsum</h3>  
                      <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip </p>  
                      <button class="btn"> Read More..</button>  
                     </div>  
                 </div>  
            </div>  
            <div class="kanan">  
            <div class="jarak">  
                <h3> CATEGORY </h3>  
                <hr/>  
                <p><a href="#" class="undercor"> HTML </a></p>  
                <p><a href="#" class="undercor"> CSS </a></p>  
                <p><a href="#" class="undercor"> BOOTSTRAP </a></p>  
                <p><a href="#" class="undercor"> PHP </a></p>  
                <p><a href="#" class="undercor"> MySQL </a></p>  
                <p><a href="#" class="undercor"> Jquery </a></p>  
                <p><a href="#" class="undercor"> Ajax </a></p>  
            </div>  
           </div>  
       </div>  
      </div>  
      <div class="footer">  
       <div class="jarak">  
       <p> copyright 2017 codebareng all reservd </p>  
       </div>  
      </div>  
 </body>  
 </html>  

Custom.css
 body {  
      background:#f3f3f3;  
      colo:#333;  
      width:100%;  
      font-family:sans-serif;  
      margin:0 auto;  
 }  
 .header{  
      width:90%;  
      margin:auto;  
      height:120px;  
      line-height:120px;  
      background:#41A85F;  
      color:#fff;  
 }  
 .content{  
      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:#41A85F;  
      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;  
 }  

Minggu, 16 September 2018

Tugas Pertemuan 4 PBOB

Ticket Machine Dengan Blue J

Tampilan Awal

Setelah memasukan Tiket dan jumlah tiket

Akan Muncul menu Baru dan pada Gambar ini menginput uang.

Ticket terprint
Class Ticket Machine

  public class TicketMachine   
  {   
   public int balance;   
   private int price;   
   private int total;   
   public TicketMachine(int ticketCost,int ticketMany)   
   {   
    balance=0;   
    price=ticketCost;   
    total=ticketMany;   
   }   
   /**   
   * Method for Ticket Machine   
   * Balance, Price, Insert Money   
   */   
   public int getBalance()   
   {   
    return balance;   
   }   
   public int getPrice()   
   {   
    return price;  
   }   
   public int getAvaiability()  
   {  
    return total;  
   }  
   public void insertMoney(int money)   
   {   
    balance = balance + money;   
   }   
   public void printTicket()   
   {   
    if(price<=balance){   
     int a = getPrice();   
     while(total>0 && balance!=0){   
      System.out.println(".----------------------");   
      System.out.println("|| Ticket CommuterTrain ");   
      System.out.println("|| Price : " + price + " rupiah ");   
      System.out.println(";______________________");   
      total--;   
     //menunjukkan sisa uang   
      balance = balance - a;   
     }   
    }   
    else {   
     System.out.println("Insufficent Money");   
    }   
   }   
  }   

Class Main
  /**   
  * Program ticket machine   
  * @author Carlo Win Marshal   
  * Version 1.00 Beta   
  */   
  import java.util.Scanner;   
  public class Main   
  {   
   public static void Main()   
   {   
    System.out.println("Welcome to the AutoTick'it");   
    System.out.println("Pleace select your ticket price (idr)");   
    System.out.println("2 Stations : 10000");   
    System.out.println("3 stations : 14000");   
    System.out.println("4 Stations : 17000");   
    System.out.println("5 Stations : 22000");   
    System.out.println("Please ask our authorized staffs for station info");   
    Scanner sc = new Scanner(System.in);   
    int cost, menu, many, sisa;   
    char yes='y';   
    System.out.print("Input your ticket price : ");   
    cost = sc.nextInt();   
    System.out.print("Input how many ticket (1 ticket/passenger) : ");   
    many = sc.nextInt();   
    TicketMachine tiket = new TicketMachine(cost,many);   
    while(true)   
    {   
    System.out.println("\nMenu");   
    System.out.println("1. Get Price");   
    System.out.println("2. Check Avaiability");   
    System.out.println("3. Insert Money");   
    System.out.println("4. Print Ticket");   
    System.out.println("5. Get Balance");   
    System.out.println("6. Take the remaining money");  
    System.out.println("7. Exit");   
    menu = sc.nextInt();   
    if(menu==7) {   
     sisa = tiket.getBalance();   
     if(sisa > 0) {   
      System.out.println("Are you sure ? You still have some money left. (y/n)");   
      yes = sc.next().charAt(0);   
     }   
     while(true){   
     if(yes=='y') {   
      break;   
     }   
     else if(yes=='n'){   
      break;   
     }   
     else {   
      System.out.println("Invalid Input");   
      break;   
     }   
    }   
    if(yes=='y'){   
     System.out.println("Thank You For Using AutoTick'it");   
     break;   
    }   
    if(yes=='n')continue;   
    }   
    int uang;   
    switch(menu)   
    {   
     case 1:   
     cost=tiket.getPrice();   
     System.out.println("Cost : "+cost+" Rupiah");   
     break;   
     case 2:   
     System.out.println("Ticket Left : "+tiket.getAvaiability());  
     break;   
     case 3:   
     uang=sc.nextInt();   
     tiket.insertMoney(uang);   
     break;   
     case 4:   
     tiket.printTicket();   
     break;   
     case 5:   
     System.out.println("Balance : "+tiket.getBalance()+" Rupiah");   
     break;  
     case 6:  
     System.out.println("All the remaining money has been taken");   
     tiket.insertMoney(-tiket.getBalance());  
     break;   
    }   
   }   
   }   
  }   

Tugas Rumah - PBOB

Tugas Rumah - Membuat sebuah pemandangan dengan BlueJ

Pada Jurnal kali ini, saya ingin menunjukkan karya saya yaitu membuat sebuah objek dan menyusunnya sehingga terlihat seperti sebuah view yang menarik.
Susunan Class dan Output canvas.

Berikut adalah Code yang digunakan :

Class Picture
 /**  
  * Main Assigment  
  *  
  *   
  *   
  * @author CarWiMa  
  * @version 1.00 (Beta)  
  */  
 public class Picture  
 {  
   private Recta door;  
   private Recta land;  
   private Square sky;  
   private Square wall;  
   private Square chimney;  
   private Triangle roof;  
   private Circle sun;  
   private Circle smoke1;  
   private Circle smoke2;  
   /**  
    * Constructor for objects of class Picture  
    */  
   public Picture()  
   {  
     // Empty field  
   }  
   public void draw()  
   {  
     sky = new Square();  
     sky.changeColor("blue");  
     sky.changeSize(500);  
     sky.makeVisible();    
     land = new Recta();  
     land.changeSize(50,300);  
     land.moveVertical(260);  
     land.changeColor("brown");  
     land.makeVisible();     
     wall = new Square();  
     wall.changeSize(100);  
     wall.moveHorizontal(70);  
     wall.moveVertical(180);  
     wall.changeColor("wall");  
     wall.makeVisible();  
     door = new Recta();  
     door.changeSize(50,30);  
     door.moveHorizontal(120);  
     door.moveVertical(230);  
     door.changeColor("smoke");  
     door.makeVisible();   
     smoke1 = new Circle();  
     smoke1.changeColor("smoke");  
     smoke1.moveHorizontal(100);  
     smoke1.moveVertical(100);  
     smoke1.changeSize(30);  
     smoke1.makeVisible();      
     smoke2 = new Circle();  
     smoke2.changeColor("smoke");  
     smoke2.moveHorizontal(80);  
     smoke2.moveVertical(120);  
     smoke2.changeSize(30);  
     smoke2.makeVisible();     
     chimney = new Square();  
     chimney.changeColor("black");  
     chimney.moveHorizontal(70);  
     chimney.moveVertical(150);  
     chimney.makeVisible();  
     roof = new Triangle();  
     roof.changeColor("roof");  
     roof.changeSize(50, 140);  
     roof.moveHorizontal(120);  
     roof.moveVertical(140);  
     roof.makeVisible();  
     sun = new Circle();  
     sun.changeColor("yellow");  
     sun.moveHorizontal(-25);  
     sun.moveVertical(-25);  
     sun.changeSize(80);  
     sun.makeVisible();  
   }  
 }  

Class Circle
 import java.awt.*;  
 import java.awt.geom.*;  
 /**  
  * Lingkaran.  
  *   
  * @author CarWiMa  
  * @version 1.00 (Beta)  
  */  
 public class Circle  
 {  
   private int diameter;  
   private int xPosition;  
   private int yPosition;  
   private String color;  
   private boolean isVisible;  
   public Circle()  
   {  
     diameter = 30;  
     xPosition = 0;  
     yPosition = 0;  
     color = "blue";  
     isVisible = false;  
   }  
   public void makeVisible()  
   {  
     isVisible = true;  
     draw();  
   }  
   public void makeInvisible()  
   {  
     erase();  
     isVisible = false;  
   }  
   public void moveRight()  
   {  
     moveHorizontal(20);  
   }  
   public void moveLeft()  
   {  
     moveHorizontal(-20);  
   }  
   public void moveUp()  
   {  
     moveVertical(-20);  
   }  
   public void moveDown()  
   {  
     moveVertical(20);  
   }  
   public void moveHorizontal(int distance)  
   {  
     erase();  
     xPosition += distance;  
     draw();  
   }  
   public void moveVertical(int distance)  
   {  
     erase();  
     yPosition += distance;  
     draw();  
   }  
   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();  
     }  
   }  
   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();  
     }  
   }  
   public void changeSize(int newDiameter)  
   {  
     erase();  
     diameter = newDiameter;  
     draw();  
   }  
   public void changeColor(String newColor)  
   {  
     color = newColor;  
     draw();  
   }  
   private void draw()  
   {  
     if(isVisible) {  
       Canvas canvas = Canvas.getCanvas();  
       canvas.draw(this, color, new Ellipse2D.Double(xPosition, yPosition,   
           diameter, diameter));  
       canvas.wait(10);  
     }  
   }  
   private void erase()  
   {  
     if(isVisible) {  
       Canvas canvas = Canvas.getCanvas();  
       canvas.erase(this);  
     }  
   }  
 }  

Class Triangle
 import java.awt.*;  
 /**  
  * Segitiga yang akan berada di Canvas  
  *   
  * @author CarWiMa  
  * @version 1.00 (Beta)  
  */  
 public class Triangle  
 {  
   private int height;  
   private int width;  
   private int xPosition;  
   private int yPosition;  
   private String color;  
   private boolean isVisible;  
   public Triangle()  
   {  
     height = 30;  
     width = 40;  
     xPosition = 0;  
     yPosition = 0;  
     color = "green";  
     isVisible = false;  
   }  
   public void makeVisible()  
   {  
     isVisible = true;  
     draw();  
   }  
   public void makeInvisible()  
   {  
     erase();  
     isVisible = false;  
   }  
   public void moveRight()  
   {  
     moveHorizontal(20);  
   }  
   public void moveLeft()  
   {  
     moveHorizontal(-20);  
   }  
   public void moveUp()  
   {  
     moveVertical(-20);  
   }  
   public void moveDown()  
   {  
     moveVertical(20);  
   }  
   public void moveHorizontal(int distance)  
   {  
     erase();  
     xPosition += distance;  
     draw();  
   }  
   public void moveVertical(int distance)  
   {  
     erase();  
     yPosition += distance;  
     draw();  
   }  
   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();  
     }  
   }  
   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();  
     }  
   }  
   public void changeSize(int newHeight, int newWidth)  
   {  
     erase();  
     height = newHeight;  
     width = newWidth;  
     draw();  
   }  
   public void changeColor(String newColor)  
   {  
     color = newColor;  
     draw();  
   }  
   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);  
     }  
   }  
   private void erase()  
   {  
     if(isVisible) {  
       Canvas canvas = Canvas.getCanvas();  
       canvas.erase(this);  
     }  
   }  
 }  

Class Square
 import java.awt.*;  
 /**  
  * Gambar Kotak Pada Canvas.  
  *   
  * @author CarWiMa   
  * @version 1.00  
  */  
 public class Square  
 {  
   private int size;  
   private int xPosition;  
   private int yPosition;  
   private String color;  
   private boolean isVisible;  
   public Square()  
   {  
     size = 30;  
     xPosition = 0;  
     yPosition = 0;  
     color = "red";  
     isVisible = false;  
   }  
   public void makeVisible()  
   {  
     isVisible = true;  
     draw();  
   }  
   public void makeInvisible()  
   {  
     erase();  
     isVisible = false;  
   }  
   public void moveRight()  
   {  
     moveHorizontal(20);  
   }  
   public void moveLeft()  
   {  
     moveHorizontal(-20);  
   }  
   public void moveUp()  
   {  
     moveVertical(-20);  
   }  
   public void moveDown()  
   {  
     moveVertical(20);  
   }  
   public void moveHorizontal(int distance)  
   {  
     erase();  
     xPosition += distance;  
     draw();  
   }  
   public void moveVertical(int distance)  
   {  
     erase();  
     yPosition += distance;  
     draw();  
   }  
   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();  
     }  
   }  
   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();  
     }  
   }  
   public void changeSize(int newSize)  
   {  
     erase();  
     size = newSize;  
     draw();  
   }  
   public void changeColor(String newColor)  
   {  
     color = newColor;  
     draw();  
   }  
   private void draw()  
   {  
     if(isVisible) {  
       Canvas canvas = Canvas.getCanvas();  
       canvas.draw(this, color,  
           new Rectangle(xPosition, yPosition, size, size));  
       canvas.wait(10);  
     }  
   }  
   private void erase()  
   {  
     if(isVisible) {  
       Canvas canvas = Canvas.getCanvas();  
       canvas.erase(this);  
     }  
   }  
 }  

Class Rectangle
  import java.awt.*;    
 /**  
  * Segiempat yang akan berada di Canvas  
  *   
  * @author CarWiMa  
  * @version 1.00 (Beta)  
  */  
  public class Recta    
  {    
   private int H;    
   private int W;   
   private int xPosition;    
   private int yPosition;    
   private String color;    
   private boolean isVisible;    
   public Recta()    
   {    
   H = 100;    
   W = 50;   
   xPosition = 0;    
   yPosition = 0;    
   color = "brown";    
   isVisible = false;    
   }    
   public void makeVisible()    
   {    
   isVisible = true;    
   draw();    
   }    
   public void makeInvisible()    
   {    
   erase();    
   isVisible = false;    
   }    
   public void moveRight()    
   {    
   moveHorizontal(20);    
   }    
   public void moveLeft()    
   {    
   moveHorizontal(-20);    
   }    
   public void moveUp()    
   {    
   moveVertical(-20);    
   }    
   public void moveDown()    
   {    
   moveVertical(20);    
   }    
   public void moveHorizontal(int distance)    
   {    
   erase();    
   xPosition += distance;    
   draw();    
   }    
   public void moveVertical(int distance)    
   {    
   erase();    
   yPosition += distance;    
   draw();    
   }    
   public void changeSize(int newH,int newW)    
   {    
   erase();    
   H = newH;    
   W = newW;   
   draw();    
   }    
   public void changeColor(String newColor)    
   {    
   color = newColor;    
   draw();    
   }    
   private void draw()    
   {    
   if(isVisible) {    
    Canvas canvas = Canvas.getCanvas();    
    canvas.draw(this, color,    
     new Rectangle(xPosition, yPosition, W, H));    
    canvas.wait(10);    
   }    
   }    
   private void erase()    
   {    
   if(isVisible) {    
    Canvas canvas = Canvas.getCanvas();    
    canvas.erase(this);    
   }    
   }    
  }    

Class Canvas
 import javax.swing.*;  
 import java.awt.*;  
 import java.util.List;  
 import java.util.*;  
 /**  
  * Canvas adalah kelas untuk menampilkan gambar  
  *  
  * @author Carlo Win Marshal  
  * @version 1.00 (Beta)  
  */  
 public class Canvas  
 {  
   private static Canvas canvasSingleton;  
   /**  
    * -Canvas-   
   */  
   public static Canvas getCanvas()  
   {  
     if(canvasSingleton == null) {  
       canvasSingleton = new Canvas("BlueJ Shapes Demo", 300, 300,   
           Color.white);  
     }  
     canvasSingleton.setVisible(true);  
     return canvasSingleton;  
   }  
   private JFrame frame;  
   private CanvasPane canvas;  
   private Graphics2D graphic;  
   private Color backgroundColour;  
   private Image canvasImage;  
   private List<Object> objects;  
   private HashMap<Object, ShapeDescription> shapes;  
   private Canvas(String title, int width, int height, Color bgColour)  
   {  
     frame = new JFrame();  
     canvas = new CanvasPane();  
     frame.setContentPane(canvas);  
     frame.setTitle(title);  
     canvas.setPreferredSize(new Dimension(width, height));  
     backgroundColour = bgColour;  
     frame.pack();  
     objects = new ArrayList<Object>();  
     shapes = new HashMap<Object, ShapeDescription>();  
   }  
   public void setVisible(boolean visible)  
   {  
     if(graphic == null) {  
       // first time: instantiate the offscreen image and fill it with  
       // the background colour  
       Dimension size = canvas.getSize();  
       canvasImage = canvas.createImage(size.width, size.height);  
       graphic = (Graphics2D)canvasImage.getGraphics();  
       graphic.setColor(backgroundColour);  
       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);  // just in case it was already there  
     objects.add(referenceObject);   // add at the end  
     shapes.put(referenceObject, new ShapeDescription(shape, color));  
     redraw();  
   }  
   public void erase(Object referenceObject)  
   {  
     objects.remove(referenceObject);  // just in case it was already there  
     shapes.remove(referenceObject);  
     redraw();  
   }  
   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(new Color(58,169,222));  
     else if(colorString.equals("roof"))  
       graphic.setColor(new Color(3,30,51));  
     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 if(colorString.equals("brown"))  
       graphic.setColor(new Color(102,51,0));  
     else if(colorString.equals("smoke"))  
       graphic.setColor(new Color(172,173,169));  
     else if(colorString.equals("wall"))  
       graphic.setColor(new Color(51,83,106));  
     else  
       graphic.setColor(Color.black);  
   }  
   public void wait(int milliseconds)  
   {  
     try  
     {  
       Thread.sleep(milliseconds);  
     }   
     catch (Exception e)  
     {  
       // ignoring exception at the moment  
     }  
   }  
   private void redraw()  
   {  
     erase();  
     for(Iterator i=objects.iterator(); i.hasNext(); ) {  
       ((ShapeDescription)shapes.get(i.next())).draw(graphic);  
     }  
     canvas.repaint();  
   }  
   private void erase()  
   {  
     Color original = graphic.getColor();  
     graphic.setColor(backgroundColour);  
     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);  
     }  
   }  
 }  

Minggu, 09 September 2018

Tugas 2 PBOB

TUGAS 2 PBOB - Pengaplikasian Class dalam blueJ


Pada pertemuan minggu ke-3 matakuliah PBO-B, dilakukan pembahasan mengenai class, dan menghubungkan class dengan class lain. Dan saya diberi tugas untuk membuat sebuah class untuk beberapa bangun ruang dan Testmainnya untuk menguji coba.

Gambar BlueJ dan Class-class yang terhubung , serta hasil Runnya: 


Berikut adalah source codenya :

TestMain :
 /**  
  * Write a description of class MyMain here.  
  *  
  * @author (Carwima)  
  * @version (1.0Beta)  
  */  
 public class TestMain  
 {  
   public static void main(String args[]){  
     Kubus aKubus;  
     aKubus = new Kubus();  
     aKubus.s=10;  
     double VK=aKubus.Vo();  
     double LPK=aKubus.LP();  
     System.out.println("\nKubus");  
     System.out.println("Sisi ="+aKubus.s+" Volume="+VK);  
     System.out.println("Sisi ="+aKubus.s+" Luas Permukaan="+LPK);  
     Balok aBalok;  
     aBalok = new Balok();  
     aBalok.p=10;  
     aBalok.l=10;  
     aBalok.t=10;  
     double VB=aBalok.Vol();  
     double LPB=aBalok.LPB();  
     System.out.println("\nBalok");  
     System.out.println("Lebar ="+aBalok.l+" Panjang ="+aBalok.p+" Tinggi ="+aBalok.t+" Volume="+VB);  
     System.out.println("Lebar ="+aBalok.l+" Panjang ="+aBalok.p+" Tinggi ="+aBalok.t+" Luas Permukaan="+LPB);  
     Tabung aTabung;  
     aTabung = new Tabung();  
     aTabung.tt=10;  
     aTabung.ra=10;  
     double VT=aTabung.Volta();  
     double LPT=aTabung.LPT();  
     System.out.println("\nTabung");  
     System.out.println("Tinggi ="+aTabung.tt+" Radius ="+aTabung.ra+" Volume="+VT);  
     System.out.println("Tinggi ="+aTabung.tt+" Radius ="+aTabung.ra+" Luas Permukaan="+LPT);  
     Bola aBola;  
     aBola = new Bola();  
     aBola.r=10;  
     double Vbo=aBola.VB();  
     double LPBo=aBola.LPBo();  
     System.out.println("\nBola");  
     System.out.println("Radius ="+aBola.r+" Volume="+Vbo);    
     System.out.println("Radius ="+aBola.r+" Luas Permukaan="+LPBo);  
   }  
 }  

Kubus:
 public class Kubus  
 {  
   public double s;  
   /*  
    * Constructor for objects of class Kubus  
    * Methods to return circumference and area  
    */  
   public double Vo()  
   {  
     // initialise instance variables  
     return s*s*s;  
   }  
   public double LP()  
   {  
     return s*s*6;  
   }  
 }  

Balok:
 public class Balok  
 {  
   public double l,p;  
   public double t;  
   /*  
    * Constructor for objects of class Balok  
    * Methods to return circumference and area  
    */  
   public double Vol()  
   {  
     // initialise instance variables  
     return l*p*t;  
   }  
   public double LPB()  
   {  
     return 2*(l*p+l*t+p*t);  
   }  
 }  

Tabung:
 public class Tabung  
 {  
   public double tt;  
   public double ra;  
   /*  
    * Constructor for objects of class Tabung  
    * Methods to return circumference and area  
    */  
   public double Volta()  
   {  
     // initialise instance variables  
     return ra*ra*3.14*tt;  
   }  
   public double LPT()  
   {  
     return 3.14*ra*(ra+tt)*2;  
   }  
 }  

Bola:
 public class Bola  
 {  
   public double r;  
   /*  
    * Constructor for objects of class Bola  
    * Methods to return circumference and area  
    */  
   public double LPBo()  
   {  
     // initialise instance variables  
     return 4*3.14*r*r;  
   }  
   public double VB()  
   {  
     return (4/3)*3.14*r*r*r;  
   }  
 }  

Selasa, 04 September 2018

Tugas 1 PWEB C

Nama : Carlo Win Marshal Kelas : STI-B NRP : 05111740000098




PWEB C - Membuat CV dengan HTML sederhana.
Dalam bagian jurnal kali ini, saya akan menyampaikan proses paling awal saya dalam membuat sebuah web, yakni sebuah tampilan sederhana menggunakan HTML.

Sedikit penjelasan mengenai tampilan web ini :
-Menggunakan style terpisah yaitu css (agar lebih mudah dalam pengaturan dan penggunaannya)
-Menggunakan foto secara data offline untuk foto profil.

Untuk info lebih lanjut, dapat dilihat pada Website Profil saya di carwima.github.io

Kode CSS
 p#test{  
      font-family: arial, sans-serif;  
      font-size:13 px;  
 }  
 p.sidebar{  
      font-size:20px;  
 }  
 table {  
   font-family: arial, sans-serif;  
   border-collapse: collapse;   
      background-color: #ffffff  
 }  
 #profile{  
      font-size:12px;  
 }  
 #cv{  
      font-size:12px;  
      display:none;  
 }  
 h2 {  
      padding: 12px 15px;  
      background-color:#ccc;  
 }  
 td, th {  
   border: 1px solid #dddddd;  
   text-align: left;  
   padding: 8px;  
 }  
 tr:nth-child(even) {  
   background-color: #dddddd;  
 }  
 body {  
      background-color: #aaa; /* For browsers that do not support gradients */  
   background-image: linear-gradient(to bottom right, #aaa, #fff); /* Standard syntax (must be last) */  
 }  
 /*main content starts*/  
 .mainsize{  
      width:600px;  
      margin:0 auto;  
 }  
 * {  
   box-sizing: border-box;  
 }  
 .column {  
   float: left;  
   padding: 10px;  
 }  
 .column.side {  
   width: 30%;  
      height:800px;  
 }  
 .column.middle {  
   width: 70%;  
      height:800px;  
 }  
 .row:after {  
   content: "";  
   display: table;  
   clear: both;  
 }  
 .footer {  
   background-color: #f1f1f1;  
   padding: 10px;  
   text-align: center;  
 }  
 /*main content ends*/  
 .header {  
   background-color: #f1f1f1;  
   padding: 30px;  
   text-align: center;  
   font-size: 35px;  
 }  
 ul {  
      list-style-type:none;  
      margin: 0;  
   padding: 0;  
   overflow: hidden;  
   background-color: #333;  
      font-family:Arial;  
      font-size:14px;  
 }  
 .block {  
   border: none;  
   background-color: #333;  
   color: white;  
   padding: 14px 16px;  
   cursor: pointer;  
   text-align: center;  
 }  
 .block:hover {  
   background-color: red;  
   color: white;  
 }  
 li {  
   float: left;  
 }  
 li a, .dropbtn {  
   padding: 14px 16px;  
   display: inline-block;  
   color: white;  
   text-align: center;  
   text-decoration: none;  
 }  
 li a:hover, .dropdown:hover .dropbtn {  
   background-color: red;  
 }  
 li.dropdown {  
   display: inline-block;  
 }  
 .dropdown-content {  
   display: none;  
   position: absolute;  
   background-color: #f9f9f9;  
   min-width: 160px;  
   box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);  
   z-index: 1;  
 }  
 .dropdown-content a {  
   color: black;  
   padding: 12px 16px;  
   text-decoration: none;  
   display: block;  
   text-align: left;  
 }  
 .dropdown-content a:hover {background-color: #f1f1f1}  
 .dropdown:hover .dropdown-content {  
   display: block;  
 }  

Kode HTML
 <!DOCTYPE html>  
 <html>  
 <head>  
 <title> Carlo's Blog </title>  
      <link rel="stylesheet" type="text/css" href="Carlo.css">  
      <meta charset="utf-8">  
      <style>  
 </style>  
      <meta name="viewport" content="width=device-width, initial-scale=1">  
 </head>  
 <body>  
 <div class="mainsize">  
      <div class="header"> Curriculum Vitae </div>  
           <ul>  
                <li>     <button class="block" onclick="Check(2)">     Informasi Umum</button></li>  
                <li>      <button class="block" onclick="Check(1)">     Riwayat Pendidikan</button></li>  
                <li class="dropdown">  
                <a href="javascript:void(0)" class="dropbtn">Prestasi</a>  
                <div class="dropdown-content">  
                 <a href="#">TBA</a>  
                </div>  
            </li>  
           </ul>  
      <div class="row">  
           <div class="column middle" style="background-color:#bbb;">  
 <!–– Batas Hidup ––>  
           <div id="profile">  
                <table>  
                <tr>  
                     <th> Profile </th>  
                     <th> Data Diri </th>  
                </tr>  
                <tr>  
                <td rowspan="6"> <img src="text594.png" width="120"></td>  
                </tr>  
                <tr>  
                     <td> Nama : Carlo Win Marshal </td>  
                </tr>  
                <tr>  
                     <td> Tanggal Lahir : 5 Juni 1999 </td>  
                </tr>  
                <tr>  
                     <td> Agama : Katolik </td>  
                </tr>  
                <tr>  
                     <td> Kewarganegaraan : Indonesia </td>  
                </tr>  
                <tr>  
                     <td> Alamat : Jl Sukolilo Kasih no 5, Surabaya </td>  
                </tr>  
                </table>  
                <br>  
                <h2>Kontak</h2>  
                     <br>  
                     <table>  
                 <tr>  
                     <th>Media</th>  
                     <th>Contact</th>  
                 </tr>  
                 <tr>  
                     <td>WA/NoHP</td>  
                     <td>082113200041</td>  
                 </tr>  
                 <tr>  
                     <td>Email</td>  
                     <td>carlowinmarshal08@gmail.com</td>  
                 </tr>  
                 <tr>  
                     <td>Line</td>  
                     <td>@camarwin</td>  
                 </tr>  
                 </table>  
           </div>  
 <!–– Batas Hidup ––>  
           <div id="cv">  
                <h2>Riwayat Pendidikan</h2>  
                <br>  
                <table>  
            <tr>  
                <th>Pendidikan</th>  
                <th>Sekolah</th>  
                <th>Tahun</th>  
            </tr>  
            <tr>  
                <td>Sekolah Dasar</td>  
                <td>SDN 08 Jakarta</td>  
                <td>2011</td>  
            </tr>  
            <tr>  
                <td>Sekolah Menengah Pertama</td>  
                <td>SMPN 117 Jakarta</td>  
                <td>2014</td>  
            </tr>  
            <tr>  
                <td>Sekolah Menengah atas</td>  
                <td>SMAN 71 Jakarta</td>  
                <td>2017</td>  
            </tr>  
            <tr>  
                <td>Perguruan Tinggi</td>  
                <td>Informatika ITS</td>  
                <td>-Present</td>       
            </tr>  
           </table>  
           <h2>Pelatihan Khusus</h2>  
                <br>  
                <table>  
            <tr>  
                <th>Pelatihan</th>  
                <th>Pelaksana</th>  
                <th>Tahun</th>  
            </tr>  
            <tr>  
                <td>Pelatihan Kewirausahaan</td>  
                <td>HMTC ITS</td>  
                <td>2017</td>  
            </tr>  
            <tr>  
                <td>Pelatihan Kepemimpinan Dasar</td>  
                <td>HMTC ITS</td>  
                <td>2018</td>  
            </tr>  
           </table>  
      </div>  
 </div>  
 <!–– Batas Hidup ––>  
           <div class="column side" style="background-color:#ccc;">  
           <p class="sidebar"> OH WHAT'S THE TIME? </p>  
                <iframe src="http://free.timeanddate.com/clock/i6ebra98/n108/tlid/fn7/fs20/tct/pct/ftb/bo2/th2" frameborder="0" width="130" height="32" allowTransparency="true"></iframe>  
           <p class="sidebar"> OH WHAT'S THE DATE? </p>  
           <iframe src="http://free.timeanddate.com/clock/i6ebs6im/n108/tlid/fn7/fs12/tct/pct/ftb/pd3/tt1/tm1" frameborder="0" width="156" height="19" allowTransparency="true"></iframe>       
           </div>  
      </div>  
      <div class="footer">2018 EnlightenTech. All rights reserved. </div>  
      </div>  
 <script>  
      function Check (a) {  
           var x = document.getElementById("cv");  
           var y = document.getElementById("profile");  
           if (a==1){  
                x.style.display = "block";  
                y.style.display = "none";  
                }  
           else if (a==2){  
                y.style.display = "block";  
                x.style.display = "none";  
           }  
      }  
      </script>  
 </body>  
 </html>  


Minggu, 02 September 2018

Tugas1-PBOB

TUGAS 1 PBO B

        Pada jurnal kali ini, saya ingin menampilkan proses awal  saya dalam memahami pemrograman berbasis objek. Dengan menggunakan tool Blue J. Berikut adalah tampilan dari bagian class yang diatur beserta file bantuan (ReadMe)




        Dan sesuai panduan yang diberikan, saya ditugaskan untuk menuliskan data diri lalu melakukan compile pada source code tersebut. 


Source Code pada class helloworld1 :
 /**  
  *Bagian dari project hello world, untuk latihan Helloword1 here.  
  *  
  * @author (Carlo Win Marshal)  
  * @version (1.0Beta)  
  */  
 public class Helloworld1  
 {  
   // instance variables - replace the example below with your own  
   private int x;  
   /**  
    * Constructor for objects of class Helloword1  
    */  
   public Helloworld1()  
   {  
     System.out.print("Tugas #PBO B - Tugas 1 \n===============\n");  
     System.out.print("Nama     : Carlo Win Marshal\n");  
     System.out.print("Kelas    : PBO B\n");  
     System.out.print("Alamat Rumah : JL SUKOLILO KASIH NO5\n");  
     System.out.print("Email    : carlowinmarshal08@gmail.com\n");  
     System.out.print("Blog     : enlightechtc.blogspot.com\n");  
     System.out.print("No HP/WA   : 082113200041\n");  
     System.out.print("Twitter   : @carlo_wM\n");  
   }  
   /**  
    * This is comment  
    *  
    * This is another comment  
    * We provide comment for better cause.  
    */  
 }