Professional Documents
Culture Documents
import java.util.Scanner;
import java.util.Random;
int a = r.nextInt(-100,100);
int b = r.nextInt(-100,100);
int c = a+b;
if(c>0) {
else if(c<0) {
else {
int x = s.nextInt();
if(x%2==0) {
else {
System.out.println("Bilangan tersebut bukan merupakan bilangan prima");
System.out.println("Input suhu:");
double x = s.nextInt();
String sh = s.next();
sh = sh.toUpperCase();
if(sh.equals("C")) {
x = x*1.8+32;
else if(sh.equals("F")) {
x = (x-32)/1.8;
int p = 0;
p++;
arr[i] = s.nextInt();
arr[j] = arr[j+1];
arr[j+1] = temp;
System.out.print(arr[i]+" ");
kata = kata.toLowerCase();
if(kata.equals(palindrom)) {
else {
System.out.println("===========================");
System.out.println("===========================");
System.out.println("Soal 1");
System.out.println("Soal 2");
System.out.println("Soal 3");
System.out.println("Soal 4");
System.out.println("Soal 5");
System.out.println("===========================");
System.out.println("===========================");
if(pilih == 1) {
soal1();
if(ulang.equals("y")) {
else {
loop = false;
System.out.println("SELESAI");
break;
else if(pilih == 2) {
soal2();
if(ulang.equals("y")) {
}
else {
loop = false;
System.out.println("SELESAI");
break;
else if(pilih == 3) {
soal3();
if(ulang.equals("y")) {
else {
loop = false;
System.out.println("SELESAI");
break;
else if(pilih == 4) {
soal4();
if(ulang.equals("y")) {
else {
loop = false;
System.out.println("SELESAI");
break;
}
else if(pilih == 5) {
soal5();
if(ulang.equals("y")) {
else {
loop = false;
System.out.println("SELESAI");
break;
else {
if(ulang.equals("y")) {
else {
loop = false;
System.out.println("SELESAI");
break;
while(loop);
}
}