#include <iostream.h>
#include <conio.h>
class volumebalok {
public:
void volume();
void hitung();
private:
float v,p,l,t;
};
void volumebalok::volume(){
cout<<"PROGRAM MENGHITUNG VOLUME BALOK"<<endl;
cout<<"nilai p : "; cin>>p;
cout<<"nilai l : "; cin>>l;
cout<<"nilai t : "; cin>>t;
}
void volumebalok::hitung(){
v=p*l*t;
cout<<"Volume Balok = " << v;
cout<<endl;
}
int main(){
volumebalok x;
x.volume();
x.hitung();
getch();
return 0;
}
0 komentar:
Posting Komentar