My First C++ Algorithm

In this 4th semester, I got a lecture Computer Programming, or I should say Basic Computer Programming.

I’ve never had a computer programming experience before. It’s little bit complicated, I should say, and make me understand why Mathematics is important for all of us who is studying engineering or science in general. Math give us a basic logic, a step by step way of thinking.

—–Writing something—–

#include<iostream>

using namespace std;
int main ()
{
cout<<“Teknobiomedik Unair\n”;

}

—- Counting area, circumference, and hypotenuse of isosceles triangle—

//Menghitung sisi miring, keliling, luas segitigga siku-siku
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
int a,t;
float s_miring, luas, keliling;

cout<<“Inputkan alas=”;cin>>a;
cout<<“Inputkan tinggi=”;cin>>t;
s_miring=sqrt((a*a)+(t*t));
luas=0.5*a*t;
keliling=a+t+s_miring;
cout<<“Sisi Miring Segitiga=”<<s_miring<<endl;
cout<<“Luas segitiga=”<<luas<<endl;
cout<<“Keliling segitiga=”<<keliling<<endl;
system(“pause”);
return 0;

}

—-Counting Ideal Weight—-

//Berat Badan Ideal
#include<iostream>
#include<math.h>
using namespace std;
int main ()
{
int tb;
float bb;
cout<<“Inputkan Tinggi Badan=”;cin>>tb;
bb=(((tb-100)-((tb-100))*0.1));
cout<<“Berat Badan Ideal=”<<bb<<endl;
}

 

Thats my first day of using C++. What’s yours.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s