FANSTACTIC 4
madarita,nor kolifatun,noridayu,eswaran
chapter 1 :
algorithm (arahan pnjg) > pseodocode (arahan pendek) > flowchart > programming C++
sample question!!!!!!!!!!!!!!!!!!
example 1 :
Find the area of rectangle
Area = width * height[/color]
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
Read width > raed height > set the area = width * height > print output >end
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 :
start > read radius > area = 3.14 * radius * radius > print output > end
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
Start > read celcius > set the area = ( 9/5 ) *( celcius + 32 ) > print output >end
Chapter 2 :
#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 ( xberubah)
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 :
start > read radius > area = 3.14 * radius * radius > print output
#include <iDStream.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
No comments:
Post a Comment