#include <iostream.h>
class v_bola {
public:
void volume();
void rumus();
private:
float v,r;
};
void v_bola::volume(){
cout<<"Program menghitung volume bola"<<endl;
cout<<"nilai r : "; cin>>r;
}
void v_bola::rumus(){
v=4/3*(3.14*r*r*r);
cout<<"Volume Bola = " << v;
cout<<endl;
}
int main(){
v_bola x;
x.volume();
x.rumus();
system ("PAUSE");
return 0;
}
Rabu, 04 April 2012
c++ Volume bola
Langganan:
Posting Komentar (RSS)
Komentar :
Posting Komentar