C++ Menghitung Luas Persegi Panjang

#include <iostream>
#include <string>

using namespace std;
class oke{
private:
int p,l,ls;
public:
int in();
int hitung();
};
int oke::in(){
cout<<“Masukan panjang: “;
cin>>p;
cout<<“Masukan lebar: “;
cin>>l;}
int oke::hitung(){
ls=p*l;}
int main()
{
cout<<“=====Menghitung luas persegi panjang=====”<<endl;
oke jos;
jos.in();
cout<<“Luas nya adalah: “<<jos.hitung();
cout<<endl;
system(“pause”);
return 0;
}

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