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
---->Tengok formula
---->Cari ade bape variable name
---->Declare variable
Input:
Cout <<“----------------------” ;
Cin >>variable_name_that_had_declared;
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
0 comments:
Post a Comment