0% found this document useful (0 votes)
8 views3 pages

Template Responsi 1

Uploaded by

Muhammad Rialdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Template Responsi 1

Uploaded by

Muhammad Rialdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Nama : Muhammad rialdi mustafa

NPM : 5240311062
Kelas : Algoritma & Struktur Data Praktik Kelas I/II

Ketentuan:
1. Responsi 1 dilaksanakan pada hari Selasa, 29 Oktober 2024.
2. Responsi dikerjakan langsung pada template yang sudah disediakan.
3. Responsi dikumpulkan dalam format PDF.
4. Format nama file yaitu NPM_Nama Lengkap_Responsi 1. Pastikan nama file sesuai ketentuan.

JAWABAN SOAL RESPONSI 1


"ALGORITMA DAN STRUKTUR DATA PRAKTIK"

Source Code
import aldi_5240311062.ayam;
import java.util.Scanner;

public class RESPONSI1 {


public static void main(String[] args) {
Scanner aldi =new Scanner (System.in);

int variasi,tb;
double harga ;
boolean pa= true ;

while (pa)
System.out.println("======================");
System.out.println("-----------------");
System.out.println("paket ayam tersedia : ");
System.out.println("-----------------");
System.out.println("\n1 ayam geprek original \n2 ayam geprek kremes \
n3 ayam geprek bakar mentai");
System.out.println("======================");
System.out.println("masukan paket ayam yang dipilih : ");

variasi = aldi.nextInt();

switch(variasi){
case 1 :
System.out.println("variasi ayam");
System.out.println("\n1.sayap \n2.paha bawah \n3.paha
atas/dada");
System.out.println("masukan variasi");
variasi = aldi.nextInt();
{
double hargaplusesteh ;
int varisai = 0 ;
variasi = aldi.nextInt();
switch (variasi){
case 1:
variasi = "sayap";
harga = 11.000;
hargaplusesteh = 15.000;
break;
case 2 :
variasi = "paha bawah";
harga = 11.000;
hargaplusesteh = 15.000;
break;
case 3 :
variasi = "paha bawah";
harga = 11.000;
hargaplusesteh = 15.000;
break ;

}
}

break;

double hargaplusesteh ;
case 2 :
System.out.println("variasi ayam");
System.out.println("\n1.sayap \n2.paha bawah \n3.paha
atas/dada");
System.out.println("masukan variasi");
variasi = aldi.nextInt();

switch (variasi){

case 1 :
variasi = "sayap";
harga = 13.000;
hargaplusesteh = 17.000;
break ;
case 2 :
variasi = "paha bawah";
harga = 14.000;
hargaplusesteh = 18.000;
break ;
case 3 :
variasi = "paha atas/dada";
harga = 16.000;
hargaplusesteh = 20.000;
break ;

}
break ;

double hargaplusesteh ;

case 3 :
System.out.println("variasi ayam");
System.out.println("\n1.sayap \n2.paha bawah \n3.paha
atas/dada");
System.out.println("masukan variasi");
variasi = aldi.nextInt();

switch (variasi){

case 1 :
variasi = "sayap";
harga = 15.000;
hargaplusesteh = 19.000;
break ;
case 2 :
variasi = "paha bawah";
harga = 16.000;
hargaplusesteh = 20.000;
break ;
case 3 :
variasi = "paha atas/dada";
harga = 18.000;
hargaplusesteh = 22.000;
break ;
}

}
}
}
Screenshot

You might also like