Input : r

Proses :

volume = (4/3)*(22/7)*r*r*r

Output : volume

==> Flowchart :

Image

==> Hasil Outputnya : 

Image

==> Program : 


#include <iostream>

#include <string>

using namespace std;

class Volume{

public:

void volume_bola();

void rumus();

private:

float phi;

float r;

float volume;

};

void Volume::volume_bola(){

cout<<"Program Menghitung Volume Bola"<<endl;

cout<<"Masukan nilai jari-jari :";cin>>r;

cout<<endl;

}

void Volume::rumus(){

float phi =3.14;

volume = 1.333333*phi*r*r*r;

cout<<"Jadi Volume Bola adalah :"<<volume<<endl;

}

main()

{

Volume Bola;

Bola.volume_bola();

Bola.rumus();

system ("PAUSE");

return EXIT_SUCCESS;

}

About niehennys

just another girl.

Tinggalkan Balasan

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

Logo WordPress.com

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

Gambar Twitter

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

Foto Facebook

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

Foto Google+

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

Connecting to %s