Daisypath Anniversary tickers

Daisypath Anniversary tickers

Monday, March 7, 2011

Lagik.. Chapter Two pulak...... (*_*)

Kat Chap 2 nih kitorg blajo pasal C++.. Erm amendealah uh.. Progamming language ke? uuuu... tu la.. mase class asik nk skip je.. padahnye sape nk nangung.. naseb ade membe yg prihatin kasik notes... Luv U gurlz.. Cayang korang.. hehe.. kat bawah nih contoh C++ yg mis aja... kalo nk wat mendealah nih mestilah berdasarkan flowchart yg kite wat uh..

#include //header
main( ) //start body
{ //open curly bracket
//declare variable
float area;
float radius;
//input 1
cout<<"Enter radius=";
cin>>radius;
//fomula
area=3.14*radius*radius;
//output
cout<<"area="< return 0;
}//close curly bracket
//end body

Nk wat coding nih kene ikot rules macam kt bawah nih:
1) Mule2 kene ikot formula macam yg die bagi, area utk circle area= 3.14*radius*radius
2) Carik brape variable name yg ade pastu declarekan
3) Pastu wat flowchart ikot soklan
cth:start>read radius>area=3.14*radius*radius>print output >end
4) Pastu wat la coding macam kt atas uh..



No comments:

Post a Comment