#!/bin/bash
clear
echo “Daftar
Mainan”;
echo
“--------------------“;
echo “1.
Kelereng “;
echo
“2.Gambaran”;
echo “3.
Mobil-mobilan”;
echo “4. Exit”;
read –p
“pilihan anda [1-4] :” pil;
if [ $pil –eq 1
];
then
echo
–n “banyaknya Kelereng = “;
read
jum
let
bayar=jum*10;
elif [ $pil –eq
2 ];
then
echo
–n “banyaknya Gambaran = “;
read
jum
let
bayar=jum*10;
if [ $pil –eq 3
];
then
echo
–n “banyaknya Mobil-mobilan = “;
read
jum
let
bayar=jum*1000;
elif [ $pil –eq
4 ];
then
exit 0
else
echo
“Maaf, Anda kurang beruntung, silahkan coba minggu depan!!”
exit
1
fi
echo “Harga
bayar = RP. $bayar”;
echo “Terima
kasih karena sudah membeli, datang lagi ya!!!!!”
Maka outputnya kurang lebih seperti ini.
Tidak ada komentar:
Posting Komentar