Wednesday, 30 December 2015

Program Menghitung Layang-Layang di Dev C++

#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
class layang_layang
{
 private :
  int t1, t2;

 public:
 int luas()
 {
  return(((t1*t2)*1/2));
 }
 void masuk(int T1, int T2)
 {
  t1=T1;t2=T2;
 }
};
int main(int argc, char** argv)
{
system ("color b");
 layang_layang umbul,umbull;
 int a,b;
cout<<"|========================|\n";
cout<<"|Menghitung Layang Layang|\n";
cout<<"|========================|\n";
cout<<"|Thedi Wrys  (1500018081)|\n";
cout<<"|========================|\n \n";
cout<<"masukkan nilai a:";cin>>a;
  cout<<"masukkan nilai b:";cin>>b;
 umbul.masuk(a,b);
 umbull.masuk(10,5);

 cout<<"Luas Pertama: "<<umbul.luas()<<endl;;
 cout<<"Luas Kedua  : "<<umbull.luas();
 return 0;

}
Layang Layang
thediwrys.blogspot.com

No comments:

Post a Comment