SAMPLE QUESTION GIVEN BY LECTURER
bm =
bi =
math=
sains =
total =
average =
formula
total = bm + bi + math + sains
average = total / 4
Thursday, February 17, 2011
Tuesday, February 15, 2011
CHAPTER THREE programming
1. Go to my Computer at desktop.
2. Go to Local Disc C.
3. Click at TC's file show.
4. Click at BIN.
5. Click at TC's application.
6. Click NEW.
7. Type data ( quesion given before ).
8. After done insert data, click COMPILE.
10. Click RUN .
11. After all process insert data, compile, run done..users may insert any data (eg: number as picture show).
2. Go to Local Disc C.
3. Click at TC's file show.
4. Click at BIN.
5. Click at TC's application.
6. Click NEW.
7. Type data ( quesion given before ).
8. After done insert data, click COMPILE.
10. Click RUN .
11. After all process insert data, compile, run done..users may insert any data (eg: number as picture show).
EXERCISE C1 & C2
Add and minus two INTEGER numbers with using the formula below:
add= num1+num2
minus= num2-num1
ANSWER
# include <> #header
main ( )
{
// variable declaration
int num 1,num 2,add,minus ;
// input 1
Cout << " enter num 1 : " ;
Cin >> num 1 ;
// input 2
Cout << " enter num 2 : " ;
Cin >> num 2 ;
// formula
add = num 1 + num 2 ;
// output
Cout << add =" <<">
// formula
minus = num 2 - num 1 ;
// output
Cout << " minus = <<
minus ;
return 0 ;
}
Wednesday, February 9, 2011
CHAPTER TWO example 1
#include //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”<
Return 0 ;
} // close curly bracket
//end bracket
CHAPTER TWO
#include //header
Main ( ) // start body
{ // Open curly bracket
} // close curly bracket
// comment hidden
// 1 line coding
/ * , * / all coding @ more than 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. 1. Look and aware of formula
2.Find how many variable name
3.Declare variable
2.Find how many variable name
3.Declare variable
Input:
Cout <<“----------------------” ;
Cin >>variable_name_that_had_declared;
Rules: carefull with spelling,alphabet small and big
Output:
Cout <<“----------------------”<<
variable_name_that_had_declared;
Monday, February 7, 2011
CHAPTER ONE example 3
CHAPTER ONE example 2
CHAPTER ONE example 1
CHAPTER ONE
ALGORITHM – Is sequences of instruction to solve a problem
PSEUDOCODE – Is the textual approach to illustrate an algorithm while flowchart is a graphical approach to illustrate an algorithm
Subscribe to:
Posts (Atom)
Followers
chit chakkks
Blog Archive
About Me
- karra mc'yudied
- stupid naive falling in love.. very sensitive n secretive.. love to be alone..