program untuk mencari Volume boLa “praktikum Alpro”

#include <iostream>
#include <string>

using namespace std;

class Volume{
public:
void input();
void output();
void proses ();
private:
int r;
float v;
float phi;
};
void Volume::input(){
cout<<“masukkan r:”<<endl;
cin>>r;
}
void Volume::proses(){
phi=3.14;
v=4/3*phi*r*r*r;
}
void Volume::output(){
cout<<“Volume Bola :”<<v<<endl;
}
int main()
{
Volume x;
x.input();
x.proses();
x.output();
system(“PAUSE”);
return 0;
}

Berikan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Logout / Ubah )

Twitter picture

You are commenting using your Twitter account. Logout / Ubah )

Facebook photo

You are commenting using your Facebook account. Logout / Ubah )

Google+ photo

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s