First Practicum( Praktikum Pertama )

The first practical matter is the sequence
practical matter is quite simple: determine the volume of the ball is the first step madein the form of flowchart using the program Reptor then converted in the form of C + +program then last is to change the form of Class preformance. Once completed laterin the identification of errors in the program.

FLowChart Volume Of the Ball

FlowChart
FlowChart

C + + program

#include <iostream>
#include <string>

using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
float Volume_Bola;
float r;
float Phi;

Phi =3,14;
raptor_prompt_variable_zzyz =”Masukkan r :”;
cout << raptor_prompt_variable_zzyz << endl;
cin >> r;
Volume_Bola =1.3*Phi*r*r*r;
cout << “Volume_Bola adalah “<<Volume_Bola << endl;
system(“PAUSE”);
return EXIT_SUCCESS;
}

C++
C++

Changes to Class

#include <iostream>
#include<string>
using namespace std;
class Volume {
friend ostream& operator<<(ostream&, Volume&);
friend istream& operator>>(istream&,Volume&);
public:

void Volum(){Vol = (1.33*3.14*r*r*r);}
private:
float r;
float Vol;

};

istream& operator>>(istream& in, Volume& masukan){
cout<<“Masukan Nilai r :”;
in>>masukan.r;
return in;
}

ostream& operator<<(ostream& out, Volume& Keluaran ){
out<<“jari_jari : “<<Keluaran.r<<endl;
return out;
}

int main()
{
Volume X;
cin>>X;
X.Volum ();
cout<<X;

system(“PAUSE”);
return EXIT_SUCCESS;
}

Changes to Class
Changes to Class

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

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