Program Kalkulator

clear
x=0;
while (($x==0))
do 
echo "MENU";
echo "1. Deskripsi Linux";
echo "2. Kalkulator Sederhana";
echo "3. EXIT";
read -p "Masukkan Pilihan Kamu :" tes;

if (($tes ==1));
then 
cat ece.txt
keluar2=0;

elif (($tes ==2));
then 
clear
keluar2=0;
while (($keluar2==0))
do
echo " -= Kalkulator Sederhana =- ";
echo " -= Menu =- " ;
echo " 1. Penjumlahan (+) ";
echo " 2. Pengurangan (-) ";
echo " 3. Perkalian (*) ";
echo " 4. Pembagian (/) ";
echo " 5. exit ";
read -p " Operasi yang akan dilakukan [1-5] : " pil ;

if (($pil ==1));
then
echo " =Penjumlahan= ";
echo -n " Bilangan pertama : ";
read bil1
echo -n " Bilangan Kedua : ";
read bil2
echo -n " Hasil penjumlahan : $bil1+$bil2 =";
echo (')expr $bil1 + $bil2¿;
keluar2=1;

elif (($pil==2));
then
echo " =Pengurangan= ";
echo -n " Bilangan pertama : ";
read bil1
echo -n " Bilangan Kedua : ";
read bil2
echo -n " Hasil pengurangan : $bil1-$bil2 =" ;
echo ¿expr $bil1 - $bil2¿;
keluar2=1;
elif (($pil==3));
then
echo " =Perkalian= ";
echo -n " Bilangan pertama : ";
read bil1
echo -n " Bilangan Kedua : ";
read bil2
echo -n " Hasil perkalian : $bil1*$bil2 =" ;
echo ¿expr $bil1 * $bil2¿;
keluar2=1;

elif (($pil==4));
then
echo " =Pembagian= ";
echo -n " Bilangan pertama : ";
read bil1
echo -n " Bilangan Kedua : ";
read bil2
echo -n " Hasil pembagian : $bil1/$bil2 =" ;
echo ¿expr $bil1 / $bil2¿;
keluar2=1;

elif(($pil==5));
then clear;
keluar2=1;
else
echo "anda salah memasukan pilihan"
fi
done

elif (($tes==3));
then clear;
exit 1;
else
echo "Anda belum memasukkan pilihan!"
fi
X=1;
done

posted under |

2 comments:

Unknown said...

ini buat besok (13 november 2010) one???

hanif said...

nyari di mana wan codingannya ??

Post a Comment

Newer Post Older Post Home

You can replace this text by going to "Layout" and then "Page Elements" section. Edit " About "

Followers


Recent Comments