Minggu, 10 April 2011

POM BENSIN

#include <cstdlib>
#include <iostream>
#include <time.h>
#include <math.h>
#include <iomanip>
using namespace std;
class SPBU{
private:
float rp;
float ltr;
int jum;
float litlit;
int jum1;
float bensin,bensin2,bensin3,bensin4;
public:
float menu();
float liter();
void rupiah();
double  ulang();
void wait (float seconds);
};
float SPBU::menu(){
char pil;
cout<<”\b”;
cout<<”\a\t\t+\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\5\5\5\5\5\5\5+\n”;
cout<<”\t\t\3                                               \3\n”;
cout<<”\t\t\3 SELAMAT DATANG DI POM BENSIN PASTI PAS BANGET \3\n”;
cout<<”\t\t\3                                               \3\n”;
cout<<”\t\t+\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\5\5\5\5\5\5\5\5+\n”;
cout << “\t\t      +———————————–+” << endl;
cout << “\t\t      |                MENU               |” << endl;
cout << “\t\t      +———————————–+” << endl << endl;
cout<<”\t\t\t\tSilahkan Pilih: \n”;
cout<<”\t\t\t\t1. Rupiah”<<endl;
cout<<”\t\t\t\t2. Liter”<<endl;
cout<<”\t\t\t\t3. Exit”<<endl;
cout<<”\t\t\t\t==================”<<endl;
cout<<”\t\t\t\tMasukkan Pilihan: “;cin>>pil;
pil=toupper(pil);
while(!((pil==’1′)||(pil==’2′)||(pil==’3′))){
cout<<”Pilian SALAH\nPilihan diluar jangkauan..!\nPilih nomor 1-3\n”;
cout<<”Pilih salah satu:”;cin>>pil;
pil=toupper(pil);
}
switch(pil){
case ’1′: rupiah(); break;
case ’2′: liter(); break;
case ’3′: cout<<”Terima Kasih\n”; system(“exit”); break;
default: cout<<”Terimakasih”<<endl;
}
}

Tidak ada komentar:

Posting Komentar