SHARE
TWEET

Rofi Satya Nugroho / H1051191045

a guest Sep 18th, 2019 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3.  
  4.  
  5. public class Daspro {
  6.  
  7.     public static void main(String[] args) {
  8.  
  9. System.out.println("Rofi Daspro");
  10.  
  11.  
  12.  
  13.  
  14.  
  15.     Scanner input= new Scanner(System.in);
  16.  
  17.     //inputan
  18.  
  19.     boolean jawaban;
  20.  
  21.     //membuat variabel dengan nama jawaban
  22.  
  23.  
  24.  
  25.     System.out.print("Nilai 3 > 1");
  26.  
  27.     jawaban = input.nextBoolean();
  28.  
  29.     //menganbil data untuk menginput jawaban
  30.  
  31.     if (jawaban == true){
  32.  
  33.     //kondisi untuk jawaban true
  34.  
  35.     System.out.println("jawaban = Ya"); }
  36.  
  37.     else { //kondisi untuk jawaban false
  38.  
  39.     System.out.println("jawaban = Tidak");
  40.  
  41.     //menampilkan jawaban
  42.  
  43.     }
  44.  
  45.  
  46.  
  47.        
  48.  
  49.      }
  50.  
  51. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top