akakom uas responsi


mport java.util.Scanner;
public class sepatu
{
public static void main(String args[])
{
Scanner masuk = new Scanner(System.in);
int  ukuran,a=180000,b=320000,c=425000;
float hargatotal;
System.out.println(" Pilihan Sepatu a   b   c ");
System.out.println();

System.out.println("Masukkan pilihan sepatu ! ");
String pil = masuk.nextLine();

if(pil.equals("a"))

{
System.out.println("Masukkan ukuran sepatu !");
ukuran = masuk.nextInt();
if (ukuran<37)
{
hargatotal = a+(a*7f/100f);
System.out.println("Harga tambah 7%");
System.out.println("Harga sepatu : "+hargatotal);
}
else if (ukuran>=37 && ukuran <= 40)
{
hargatotal = a-(a*10f/100f);
System.out.println("Diskon 10%");
System.out.println("Harga sepatu : "+hargatotal);
}
else if (ukuran >= 41 && ukuran <=43)
{
hargatotal = a-(a*5f/100f);
System.out.println("Diskon 5%");
System.out.println("Harga sepatu  : "+hargatotal);
}
else
{
System.out.println("Ukuran salah");
}
}
if ( pil.equals("b"))
{
System.out.println("Masukkan ukuran sepatu !");
ukuran = masuk.nextInt();
if (ukuran>=30 && ukuran<=35)
{
hargatotal = b-(b*40f/100f);
System.out.println("Diskon 40%");
System.out.println("Harga sepatu : "+hargatotal);
}
else if (ukuran>=36 && ukuran <= 40)
{
hargatotal = b-(b*15f/100f);

    Blogger Comment
    Facebook Comment

0 komentar:

Post a comment

Thanks For Your Feedback.