package ifelse;
import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Toshiba
*/
public class else21 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner masuk=new Scanner(System.in);
System.out.println ("Paket1");
System.out.println ("Paket2");
System.out.println ("Paket3");
System.out.println ("Paket4");
System.out.println ("Pilih Paket = ");
int nilai=masuk.nextInt();
if(nilai==1){
System.out.print("harga = Rp.20.000");
System.out.print("kuota = 30Gb");
}else if(nilai==2){
System.out.print("harga = Rp.40.000");
System.out.print("kuota = 60Gb");
}else if(nilai==3){
System.out.print("harga = Rp.80.000");
System.out.print("kuota = 90Gb");
}else if(nilai==4){
System.out.print("harga = Rp.100.000");
System.out.print("kuota = 120Gb");
}
}}
Screenshoot Source Code
Screenshoot Run

