Latest News :

Tugas Bahasa Pemrograman Java

Posted by at Selasa, 22 September 2015


Tugas BP1
Sistem Informasi
UPN "Veteran" Jawa Timur


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tokobidjie;

import javax.swing.JOptionPane;
import java.util.Scanner;

/**
 *
 * @author Canang Cita
 */
public class Tokobidjie {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        /* TODO code application logic here
        Materi di kelas :
        kata biru = Preserved Words
       
        System.out.println("Hello Coeg !");
        System.out.println("Canang Cita");
       
        */
       
        System.out.println("Selamat Datang di 'TOKO P. JONO'");
        System.out.println("Jangan lupa bahagia!");
       
       
        /*System.out.println("Bawang 1 kg = " + 9000*1);
        System.out.print("Bawang 3 kg = " + 9000 * 3);
        */
       
        System.out.println("__________________");
        System.out.println("Bawang 3 Kg");
        int harga = 1000;
        int jumlah = 3;
        int biaya;
       
        biaya=harga*jumlah;
        System.out.println("Harga = " + biaya);
       
        System.out.println("__________________");
        System.out.println("Cabe 1 orang");
        int harga_1 = 99999000;
        int jumlah_1 = 1;
        int biaya_1;
       
        biaya_1=harga_1*jumlah_1;
        System.out.println("Harga = " + biaya_1);
       
        System.out.println("__________________");
        System.out.println("Terong 10 buah");
        int harga_2 = 7000;
        int jumlah_2 = 10;
        int biaya_2;
       
        biaya_2=harga_2*jumlah_2;
        System.out.println("Harga = " + biaya_2);
       
        System.out.println("__________________");
       
        System.out.println("Harga bawang @ 3000");
      Scanner sc = new Scanner (System.in) ;
      System.out.println("Masukkan jumlah pembelian dibawah ini :");
      int z=sc.nextInt();
      int a = 3000 ;
     
      System.out.println("Total pembelian bawang = " + z*a);
             
       
    }
   
}




Share this Post :

0 komentar: