Sabtu, 09 Maret 2013


1. Membuat program sisa bagi operator hasilnya  sisa bagi=11/4 adalah 3 sisa bagi 13.75/4 adalah 1.75 ?

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package operator;

/**
 *
 * @author DhoNa
 */
public class Operator {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int a = 11;
        int b = 4;
        double c = 13.75;
        double sisa_bagi = a%b;
        double sisa_bagi1 = c%b;
        System.out.println("sisa bagi 11/4 adalah" +sisa_bagi);
        System.out.println("sisa bagi 13.75/4 adalah"+sisa_bagi1);
    }
}

1. buatlah operator logika outputnya operasi AND,OR,XOR,NOT.

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package operatorand;

/**
 *
 * @author DhoNa
 */
public class OperatorAND {

Program Total Gaji pada MinGw


# include <stdio.h>
# include <conio.h>
void a();
void b();
int pajak;int z;char e;int k;int gaji;int p;int kerja;
main()
{
char g[200];
printf("Masukan nama:");scanf("%s",&g);
printf("Masukkan Golongan:");scanf("%s",&e);
printf("Masukkan jumlah hari kerja:",k);scanf("%d",&k);

MID SEMESTER 1 (NETBEANS)


1. Buatlah program integer dg hasil yang akan ditampilkan
dilayar hasil=6??

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package programinteger;

/**
 *
 * @author DhoNa
 */
public class ProgramInteger {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int a=3;
        a+= 3;
        System.out.println("hasil " +a);
    }
}

Program Password dan username pada MinGw


#include <stdio.h>
#include <string.h>
int main()
{
char Pass[25];
char user[255];
int a = 'y'||'n';
ulang:

printf ("\n ^^^^^^^^^^^^ Welcome to Facebook ^^^^^^^^^^^^ \n");
printf("\n");
printf("Masukkan User Name \t: ");scanf("%s",user);
printf("Masukkan Password \t: ");scanf("%s",Pass);
if ((strcmp(Pass, "3saudara")==0)&&(strcmp(user,"Bella")==0))
printf("\n^^^^^^^^^^^ Welcome to Facebook ^^^^^^^^^^^^^");

else
printf("\n Warning ! Password and User Name invalid !");

}

Operator.class


import javax.swing.JOptionPane;

public class operator
{
public static void main (String args [])
{
String input ="";
String keter ="";
int angka1 = 0;

input = JOptionPane.showInputDialog("Masukkan masa kerja Anda : ");
angka1 = Integer.parseInt(input);

keter = (angka1 > 10) ? "Tunjangan menjadi 500000":"Tunjangan menjadi 300000";

JOptionPane.showMessageDialog (null,keter);

System.exit(0);
}
}

Karak.class


public class karak
{
public static void main (String args [])
{
char ch ='a';
char ch1 = 'B';
char besar = Character.toUpperCase(ch);
char kecil = Character.toLowerCase(ch1);
boolean cek = Character.isUpperCase(ch1);
boolean cek1 = Character.isDigit(ch);

System.out.println("Huruf kapital : " + besar);
System.out.println("Huruf kecil : " + kecil);
System.out.println("Apakah huruf besar : " + cek);
System.out.println("Apakah berupa angka : " + cek1);
System.out.print("\n");

System.out.println("Dia berkata \"Assalamu'alaikum\" ke saya.");
System.out.println ("Selamat siang \rmakalah");
System.out.println ("Selamat siang \f makalah");
System.out.println ("Selamat siang, apakah 'makalah' presentasi sudah jadi/beres ?");
}
}

Array List

//konversi array ke list

import java.util.Arrays;
import java.util.Collections;
import java.util.*;
import java.io.*;

public class arraylist
{
  public static void main(String args[])
 {
  String[] strArray = new String[] {"Merah", "Putih", "Biru", "Hijau","Ungu"};

  List ls = Arrays.asList(strArray);
  Collections.sort(ls);
  System.out.println(ls);
  }
}

Speech Malin Kundang


Malin Kundang

Once upon a time, on the north coast of Sumatra lived a poor woman and his son. The boy was called Malin Kundang. They didn’t earn much as fishing was their only source of income. Malin Kundang grew up as a skillful young boy. He always helps his mother to earn some money. However, as they were only fisherman’s helper, they still lived in poverty. “Mother, what if I sail overseas?” asked Malin Kundang one day to his mother. Her mother didn’t agree but Malin Kundang had made up his mind. “Mother, if I stay here, I’ll always be a poor man. I want to be a successful person,” urged Malin kundang. His mother wiped her tears, “If you really want to go, I can’t stop you. I could only pray to God for you to gain success in life,” said his mother wisely. “But, promise me, you’ll come home.”

I LAY MY LOVE ON U -westlife-


just a smile and the rain is gone
can hardly believe it (yeah)
there's an angel standing next to me
reaching for my heart

just a smile and there's no way back
can hardly believe it (yeah)
but there's an angel, she's calling me
reaching for my heart

© Bella Yulianita 2012 | Blogger Template by Enny Law - Ngetik Dot Com - Nulis