TUESDAY, FEBRUARY 8, 2011
flow chart :
example 2:
example 3:
#include <IDStream.h> //header
Main ( ) // start body
{ // Open curly braket
} // close curly braket
// comment hidden
// 1 baris coding
/ * , * / sume coding @ lbh dr 1 coding
Declare variable
Data_type variable_name
Data type
Int | Integer | |
Float | Float | Decimal |
Double | Double | Decimal |
Char | Character | a-z /A-Z |
String | String | Sentences |
Const | Constant | Tak berubah |
Rules:
1. ~ Tengok formula
2. ~Cari ade bape variable name
3. ~Declare variable
Input:
Cout <<“----------------------” ;
Cin >>variable_name_that_had_declared;
Rules: carefull dgn ejaan,huruf (kck & bsr)
Output:
Cout <<“----------------------”<<
variable_name_that_had_declared;
sample question!!!!!!!!!!
flow chart :
#include <iostream.h>//header
Main( ) //start body
{ // Open curly braket
//declare variable
Float area;
Float radius;
// input 1
Cout <<“enter radius”;
Cin>> radius;
//formula
area = 3.14 *radius*radius
//output
Cout <<“answer”<<area ;
Return 0 ;
} // close curly braket
//end baraket
* ciap pown tok chptr 2 nie...
chptr 2 nie agk ssh..tp kalo kite ley fhm n focus bnda nie sng jewk....hhehehe
ape yg pnting : kne wt step by step...
kalo kite da slh wt tok algoritm o pseudocode mknye kite akn slh gk wt bnda nie...
alert kt ejaan ea...jgn ade yg slh...
MONDAY, FEBRUARY 7, 2011
ALGORITHM – Is sequences of instruction to solve a problem…(ayt yg pngjg2)
PSEUDOCODE – Is the textual approach to illustrate an algorithm while flowchart is a graphical approach to illustrate an algorithm (ayt yg pndk)
sample question!!!!!!!!!!!!!!!!!!
example 1 :
Find the area of rectangle
Area = width * height
Algorithm
1.Get the width of rectangle
2.Get the height of rectangle
3.Calculate the area of rectangle with multiply width by height
4.Display the area of rectangle
Pseudocode
1.Read width
2.Read Height
3.Set the area = width * height
4.Print output
Flow chart
example 2:
find the area of celcius
celcius = (5/9) * ( fahrenheit-32)
Algorithm
1.get the fahrenheit of celcius
2.calculate celcius equal to five devide by name multiply by fahrenheit minus 32
3.display the area of celcius
pseudocode:
1.read fahrenheit
2.set the celcius = (5/9) * ( fahrenheit - 32 )
3.print output
flow chart :
example 3:
find the area of fahrenheit
fahrenheit =( 9/5 *( celcius + 32 ) )
Algorithm
1.get the celcius of fahrenheit
2.calculate fahrenheit equal nine devide by five multiply celcius plus 32
3.display fahrenheit
pseudocode
1.read celcius
2.set the fohrenheit ( 9/5 *( celcius + 32 ) )
3.print output
Flow chart
No comments:
Post a Comment