#include <iostream>
using namespace std;
class segitiga {
public :
segitiga ();
void input();
void proses();
private :
int a;
int t;
int hasil;
};
segitiga::segitiga(){
cout<<"=================================\n";
cout<<"\n\nLuas Segitiga Siku-siku : \n"<<endl;
cout<<"=================================\n";
}
void segitiga::input (){
cout<<"Masukkan Alas : ";
cin>>a;
cout<<"Masukkan Tinggi : ";
cin>>t;
}
void segitiga::proses(){
hasil = (a*t)/2;
cout<<"Luas : "<<hasil;
}
main ()
{
segitiga Sgtg;
Sgtg.input();
Sgtg.proses();
return 0;
}
Raptor :
using namespace std;
class segitiga {
public :
segitiga ();
void input();
void proses();
private :
int a;
int t;
int hasil;
};
segitiga::segitiga(){
cout<<"=================================\n";
cout<<"\n\nLuas Segitiga Siku-siku : \n"<<endl;
cout<<"=================================\n";
}
void segitiga::input (){
cout<<"Masukkan Alas : ";
cin>>a;
cout<<"Masukkan Tinggi : ";
cin>>t;
}
void segitiga::proses(){
hasil = (a*t)/2;
cout<<"Luas : "<<hasil;
}
main ()
{
segitiga Sgtg;
Sgtg.input();
Sgtg.proses();
return 0;
}
Raptor :
Comments
Post a Comment