public class miftahuljannah
{
public static void main (String[] args)
{
double a = 235, b = 235, c = -236;
System.out.println ("Nama\t\t: MIFTAHUL JANNAH");
System.out.println ("Kelas\t\t: TIF 1 A");
System.out.println ("Tugas\t\t: DASPRO (JAVA)\n");
System.out.println ("\t\tDiketahui");
System.out.println ("a = 235\t\tb = 235\t\tc = -236\n");
System.out.println ("Penjumlahan");
System.out.println ("^^^^^^^^^^^");
System.out.println ("\t\ta+b = " + (a+b));
System.out.println ("\t\tb+c = " + (b+c));
System.out.println ("\t\tc+a = " + (c+a));
System.out.println ("Perkalian");
System.out.println ("^^^^^^^^^");
System.out.println ("\t\ta*b = " + (a*b));
System.out.println ("\t\tb*c = " + (b*c));
System.out.println ("\t\tc*a = " + (c*a));
System.out.println ("Sama dengan");
System.out.println ("^^^^^^^^^^^");
System.out.println ("\t\ta=b = " + (a == b));
System.out.println ("\t\tb=c = " + (b == c));
System.out.println ("\t\tc=a = " + (c == a));
System.out.println ("Tidak sama dengan");
System.out.println ("^^^^^^^^^^^^^^^^^");
System.out.println ("\t\ta!=b = " + (a != b));
System.out.println ("\t\tb!=c = " + (b != c));
System.out.println ("\t\tc!=a = " + (c != a));
System.out.println ("Besar atau sama");
System.out.println ("^^^^^^^^^^^^^^^");
System.out.println ("\t\ta>=b = " + (a >= b));
System.out.println ("\t\tb>=c = " + (b >= c));
System.out.println ("\t\tc>=a = " + (c >= a));
System.out.println ("Kecil atau sama");
System.out.println ("^^^^^^^^^^^^^^^");
System.out.println ("\t\ta<=b = " + (a <= b));
System.out.println ("\t\tb<=c = " + (b <= c));
System.out.println ("\t\tc<=a = " + (c <= a));
System.out.println ("Mod");
System.out.println ("^^^");
System.out.println ("\t\ta%b = " + (a % b));
System.out.println ("\t\tb%c = " + (b % c));
System.out.println ("\t\tc%a = " + (c % a));
System.out.println ("Div");
System.out.println ("^^^");
System.out.println ("\t\ta/b = " + (a / b));
System.out.println ("\t\tb/c = " + (b / c));
System.out.println ("\t\tc/a = " + (c / a));
System.out.println ("Casting");
System.out.println ("^^^^^^^");
a = b;
b = c;
c = a;
System.out.println ("\t\ta -> b = " + a);
System.out.println ("\t\tb -> c = " + b);
System.out.println ("\t\tc -> a = " + c);
}
}
Java (Penjumlahan, pengurangan, perkalian, mod, div)
CONTOH TUGAS DASAR PEMROGRAMAN JAVA
Posted by
Koreanoke
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Please leave a comment !!