#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
class persegi {
public :
persegi ();
void input();
void proses();
private :
int p;
int l;
int hasil;
};
persegi::persegi(){
cout<<"=================================\n";
cout<<"Menghitung Luas Persegi Panjang\n";
cout<<"=================================\n";
}
void persegi::input (){
cout<<"Masukkan Panjang : ";
cin>>p;
cout<<"Masukkan Lebar : ";
cin>>l;
}
void persegi::proses(){
hasil = p*l;
cout<<"Luas : "<<hasil;
}
int main(int argc, char** argv) {
persegi Prsg;
Prsg.input();
Prsg.proses();
return 0;
}
Raptor :
Comments
Post a Comment