#include<iostream.h>
#include<string.h>
#include<conio.h>
main ()
{
char pass [30], Pilihan [2];
float a, b, Log;
int menu;
do{
clrscr();
mulai :
cout << "Silahkan Masukkan
Password untuk mulai "<<endl;
cout << "Password = ";
cin >> pass;
}while(strcmp(pass, "admin")!=0);
cout << "Password Benar";
clrscr();
menux:
cout << "1. Log(ab)\n";
cout << "2. Log(a/b)\n";
cout << " Pilih Menu = ";
cin >> menu;
switch (menu)
{
case 1 :
cout << "Masukan Nilai a = ";
cin >> a;
cout << "Masukan Nilai b = ";
cin >> b;
Log = (a * b);
cout << "Hasil : "<<Log;
cout << "\nHitung Lagi [y/t] : ";
cin >> Pilihan;
if(strcmp(Pilihan,"y")==0)
if(strcmp(Pilihan,"t")==0)
{
clrscr();
goto menux;
}else{
goto mulai;
}
break;
case 2 :
cout << "Masukan Nilai a = ";
cin >> a;
cout << "Masukan Nilai b = ";
cin >> b;
Log =(a/b);
cout << "Log (a/b) : "<<Log;
cout << "\nHitung Lagi [y/t] : ";
cin >> Pilihan;
if(strcmp(Pilihan,"y")==0)
if(strcmp(Pilihan,"t")==0)
{
clrscr();
goto menux;
}else{
goto mulai;
}
break;
default :
cout << "Menu yang anda pilih tidak ada";
break;
}
}
Sabtu, 30 Maret 2013
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar