#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
class jajargenjang{
int a,t;
public:
void jajar(int a,int t);
int area(void){return(a*t);}
};
void jajargenjang::jajar(int x,int y){
a=x;
t=y;
}
int main(int argc, char** argv) {
jajargenjang rect;
int x,y;
cout<<"Masukkan alas : ";cin>>x;
cout<<"Masukkan tinggi : ";cin>>y;
rect.jajar(x,y);
cout<<"luas:"<<rect.area();
return 0;
}
Tidak ada komentar:
Posting Komentar