(Help) Ada yg bisa koreksi ini ga???

Discussion in 'Programming & Reverse Engineering' started by pnoy, Dec 2, 2009.

  1. pnoy

    pnoy Member

    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    11
    tolong para master java sekalian...
    koreksi script java dibwh ini..dmn penulisan kode yg salah'a truz kl dh dikoreksi output'a kya gmn

    trm ksh sblm n ssudah'a bwt pra master....

    ni script'a :

    class Hitung {

    static int tambah (int x, int y)
    {return x+y;}
    static double tambah (double x, double y)
    {return x+y;}
    static int tambah (int x , int y, int z)
    {return x+y+z;}
    static void tambahan (int x, int y)
    { System.out.println(x+y); }

    static void main (String[]a) {
    int x= 76; // x adalah jumlah 2 digit terakhir NPM anda
    int angka1; double angka2;
    int[] y=new int [10];
    angka1= (int) tambah (4,5.2)+x;
    angka2= tambah (x,4,5) / tambah(1,1,0)*2;
    int angka3= 4 + tambah (tambah(3,2),2,5)-2;
    tambahan (angka3, angka1);
    System.out.println(tambahan(2,x));
    tambahan (tambah(2,tambah(4,5)), tambah(4,6));
    System.out.println(angka1);
    System.out.println(angka2);
    System.out.println(angka3);
    angka1=tambahan(x+tambah(x,4));
    System.out.println(tambahan)2,4)-x);
    for (int i=0; i<10; i++)
    if (x%2 == 1)
    y=x+i;
    else y=x-i;
    int i=9;
    while (i>0)
    { System.out.println(y); i=i-1; }
    }
    }
     
  2. pandaris03

    pandaris03 New Member Super Member

    Messages:
    1,385
    Likes Received:
    603
    Trophy Points:
    123
    sundul ah..,
    manto dulu
     

Share This Page