suke ta suke, tuless jeeerk . . FOP oouuhhh FOP. .best ke kw? ? xD

2/04/2011

chapter two ..

Dlm bab niyyy plakk, blaja pasal C++.. yg aq paam C++ niy blaja pasal programming language ? coding.. dlu mse amek subject PCC 2 aq ad blaja coding gak.. utk wt website.. blja yg basic basic jerr.. tp dlm C++ niy laen lg.. cyesly aq ta bp na paam mse miss terang kn sal coding tuhh.. mcm bese, muke aq blurr.. huhu aq take note jelaaa.. niy la cth C++ yg miss aja utk crik area of circle.. wt bnde niy bdasarkn flow chart yg itew da wt..
 #include<iostream.h> //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="<<area;
return 0;
}//close curly bracket
 //end Body

Care nk wt dy sbnanye cm niyy :
1) ptme skly yg kite kne wat ialah tgok formula yg dy da bg tuuh..cth nye mcm kt ats yg aq da wt tuhh.. area utk circle is area=3.14*radius*radius

2) pastuh tgok kt formula tuh, crik ad bp byk variable name

3) pastuh declare variable

4) da siap declare variable, wt flow chart bdasarkan soklan yg dy bg (jgn sala simbol)
cth : start > read radius > area=3.14*radius*radius > print output > end

5) start wt coding.. ade beberape pkare yg sgt penting dlm coding niy.. antarenye :
= utk starting, jgn lupe nk wt #include<iostream.h> dlm 1st line
= 2nd line lak jgn lupe wt main()
= 3rd line jgn lupe wt {
= line pleng last jgn lupe wt }
= sume tentang flow chart kne tulis dlm body
= sume di tulis dlm hruf kcik
= xbole ade space except 4 the certain part mcm comment, declare variable and input&output yg ade dlm ("") nan return 0
=jgn lupe letak simbol ;

         + Comment
  • // = utk 1 baris coding
  • /* , */ = utk ksuluruhan coding / >1 baris coding
  • xkesa nk ltk space or nk rpt kn jer
+ Declare variable ( Start ) 
    DATA TYPEINTEGER
    IntegerInteger (o-9)
    FloatFloat (decimals)
    DoubleDouble (decimals)
    CharCharacter (a-z / A-Z)
    StringString (Sentences)
    ConstConstant (pi=3.142)
+ Input
           cout<<"________";
           cin>>variable_name_thae_had_declare ;

RULES :
  • Bjage2 nan ejaan, hruf bsr&hruf kcik
  • key in ekot soklan, lw dlm soklan bahasa melayu= xley suke suke ltx bm (kne sbijik mcm soklan)
  • dlm ( " " ) xkesa nk ltx space ke tanak
+ Output
         cout<<"______"<<variable_name_that_had_declared ;

No comments:

Post a Comment