Posts

Showing posts from October, 2021

Program Perulangan Bercabang "Bilangan Prima"

Image
Nama : Rayhan Qalby Ramadhan NPM : 21082010008 Source Code : package perulangan; import java.util.Scanner; /**Bilangan Prima  * @author Rayhan Qalby Ramadhan  * NPM 21082010008  */ public class LoopBersarang {     public static void main(String[] args) {             Scanner sc = new Scanner(System.in);             int BanyakBilPrima, hitungAngka = 0, angka = 2;             System.out.println("Program Menampilkan N Bilangan Prima Pertama");             System.out.println("============================================");             //Memasukkan Banyaknya Bilangan Prima             System.out.print("Masukkan Banyaknya Bilangan Prima       = ");             BanyakBilPrima = sc.nextInt();             System.out....

Program Perulangan "Rumah Makan Pak Kirun"

Image
 Nama : Rayhan Qalby Ramadhan NPM : 21082010008 Source code : package perulangan; import java.text.NumberFormat; import java.util.Scanner; public class RumahMakan2 {     public static void main(String[] args) {         NumberFormat hrg = NumberFormat.getInstance();         hrg.setMaximumFractionDigits(3);         Scanner sc = new Scanner (System.in);         int pilih, pilih2, jumlahmakanan, kartumember;         double diskon, hargasetelahdiskon, uangkembali, uangpembeli;         int harga, totalharga;         int totalhargasate = 0, totalhargapecel = 0, totalhargapenyetan = 0;             System.out.println(" ---------- Selamat Datang di Rumah Makan Pak Kirun ----------");             System.out.println(" ------------------ ANDA PUAS KAMI SENANG ------------------");   ...