BLOGGER TEMPLATES AND TWITTER BACKGROUNDS »

Thursday, February 10, 2011

EXERCISE , EXERCISE , AGAIN AND AGAIN

DATE : 9 FEB (WED)

EXERCISE 1 

Exercise programming ( group discussion )

Question :-
Add and minus number 1 & number 2 with using the formula below

ADD = NUM1 + NUM2
MINUS = NUM2 - NUM1

Flowchart : Start ---> read number 1 ----> read number 2 ----> add = num1 + num2 / minus = num2 - num1 --- > display output ----> end

Exercise programming ( group discussion )

Question :-
Add and minus number 1 & number 2 with using the formula below

ADD = NUM1 + NUM2
MINUS = NUM2 - NUM1

Flowchart : Start ---> read number 1 ----> read number 2 ----> add = num1 + num2 / minus = num2 - num1 --- > display output ----> end

Programming :-

# include < iostream.h >
main ()
{
// variable declaration
int num1 , num2 , add ,minus ;
// input 1
cout << " enter num1 : " ;
cin >> num1 ;
// input 2
cout << " enter num2 : " ;
cin >> num2 ;
// formula
add = num1 + n2 ;
// output
cot << " minus = <<
minus ;
return 0
}


EXERCISE 2

BAHASA MELAYU =
BAHASA INGGERIS =
MATEMATIK =
SAINS =

TOTAL=
AVERAGE=

FORMULA

total=bm+bi+math+sains
average=total/4

method :- ( di praktikkan dalam komputer hak cosmopoint sahaja )
1. open your computer
2. go to my computer ---> local disk (C:) ----> folder TC ----> folder BIN ----> pic MSDOS

*** if cannot, find folder TC at loal disks (C:) , go to folder program , Files ---> folder TC ----> folder BIN ---- >pic MSDOS

3. after open the turbo ctt file ---> new ---> type your group coding
4. to cmpile , go to compilemenu
5. to run , go to run menu


Rules:
---->Tengok formula
---->Cari ade bape variable name
---->Declare variable

Input:
Cout <<“----------------------” ;
Cin >>variable_name_that_had_declared;
WARNING : BE CAREFULL HURUF KECIL DAN BESAR

Output:
Cout <<“----------------------”<<
variable_name_that_had_declared;

EXAMPLE OF PROGRAMMING

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 bracket
//end bracket

FOP CHAPTER 2

C++ BASICS 
DATE : 2 FEB 2011 (WED)

C++  language consists of two basic elements :-
1. Semantics
2. Syntax

How to create the programming ?

compulsory symbol before starting to create the programming


#include <IDStream.h> //header
Main ( ) // start body
{ // Open curly braket
} // close curly braket
// comment hidden
/ * , * /

Declare variable

Data_type and variable_name

int = integer 0-9
float = float (decimal)
double = double (decimal)
char = character (a-z / A-Z)
string = string (sentences)
const = constant ( tidak berubah )

Rules:
---->Tengok formula
---->Cari ade bape variable name
---->Declare variable

Input:
Cout <<“----------------------” ;
Cin >>variable_name_that_had_declared;
WARNING : BE CAREFULL HURUF KECIL DAN BESAR

Output:
Cout <<“----------------------”<<
variable_name_that_had_declared;

EXAMPLE OF PROGRAMMING

Flow chart

start > read radius > area = 3.142 * 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.142 *radius*radius
//output
Cout <<“answer”<<area ;
Return 0 ;
} // close curly bracket
//end bracket

Friday, February 4, 2011

FOP CHAPTER1

DATE : 2 FEB 2011 ( WED )

PROGRAMMING AND PROBLEM SOLVING 
1) Algorithm - Is a sequence of instruction to solve a problem. It can be written in human language and programming language.

Example : Determines the area of rectangle .

FORMULA = WIDTH*HEIGHT

1. Get the width of the rectangle
2. Get the height of rectangle
3. Calculate the area using the formula
4. Annouce the answer

2) Pseudocodes - Is an outline of a program , written in a form that can easily be converted into real programming statements.

Example : Determines the area of rectangle .

FORMULA = WIDTH*HEIGHT

1. Read the width
2. Read the height
3. Set the area to the width multiplied by height
4. Print the area

3) Flowchart - Flowchart is a graphic representation of the logic or steps in a program .

Example of flowchart :  start > read width > set the area = width*height > print output > end

4) The software life cycle ( remark list down in exam )
    1. Analysis and specification of the task (problem definition)
    2. Design of the software (algorithm design)
    3. Implementation (coding)
    4. Testing
    5. Maintenance and evolution of the system
    6. Obsolescence

EXERCISE TIME !!!

Question 1 : print the area of circle area 
                  
                  FORMULA : CIRCLE AREA = 3.142*RADIUS*RADIUS

Agorithm : 1. Get the radius of circle
                 2. Calculate the area of circle with 3.142 multiply radius by radius
                 3. Display the area of circle
Pseudocode : 1. Read the radius
                        2. Set the area = 3.142*radius*radius
                        3. Print output

Flowchart : start > read radius > 3.142*radius*radius > print output > end


Question 2 : Find the celcius

                FORMULA : CELCIUS = (5/9)*(FAHREINHEIT-32)

Algorithm : 1. Get the fahreinheit of celcius
                  2. Calculate the celcius equal to five devide by nine multiple fahreinheit -32
                  3. Display celcius

Pseudocode :1. Read fahreinheit
                       2. Set the celcius = (5/9)*(fahreiheit-32)
                       3. Print output

Flowchart : start > read fahreinheit > calculate (5/9)*(fahreinheit-32) > print output > end


Question 3 : Find the fahreinheit

                  FORMULA : FAHREINHEIT  =( 9/5) *( CELCIUS + 32 ) 

Algorithm : 1. Get the celcius of fahreinheit
                  2. Calculate the fahreinheit equal nine divide by five multiply celcius 32
                  3. Display fahreinheit


Pseudocode : 1. Read celcius 
                        2. Set the fahreinheit =(9/5)*(celcius +32)
                        3. Print output


Flowchart : Start > read celcius > set the fahreinheit = (9/5)*(celcius +32) > print output > end




FINISH CHAPTER 1 !!!!!!!!!!!!!!!!!!   

feel so tired to finish it coz this is 1st time i'm create a blog like this !!