Friday, April 15, 2011

SECTION A


 
SECTION B
 
     1) Data Types

    2) If...else Statement

 
 3) Switch...case Statement


Wednesday, March 30, 2011

ASSIGNMENT ONE,,,,!!!

QUESTION
Write a program :
* * * * * * * * * * * * * * * * *
M E S I N T I N M I N U M A N
- - - - - - - - - - - - - - - - -
Jenis                                   RM
- - - - - - - - - - - - - - - - -
1.Pepsi                               1.80
2.Coca Cola                       1.90
3.F&N Orange                  1.50
4.F&N Mirinda                 1.60
5.100 Plus                       2.00
* * * * * * * * * * * * * * * * *
your selection :
Insert your money :

*Your Balance are ________
* Please insert _________ . Your money is not enough !! : _________

Thank You !
Please Come Again

ANSWER :Step 1 :
       

Step 2 :
       

Step 3 :
       

Step 4 :
       

Steap 5 :
       

Step 6 :
       

Step 7 :
            

Step 8 :
       

Step 9 :
       

Step 10 :
       
      
Step 11 :
       

Step 12 :
       

Step 13 :
       

Step 14 :
       

Step 15 :
       

Step 16 :
       

Step 17 :
       

Step 18 :
       

Step 19 :
       

homework lah,,,,,!

1) Complete the code that can calculate total marks for 3 students
for(int stud=1;____(a)____;stud++)
{
cout<<"Enter Student name:";
____(b)____name;
for(int mark=1;mark<=3;____(c)____)
{
cout<<"Enter assigment marks:";
cin>>marks;
total=____(d)____+marks;
}
}
cout<<"Total marks are"<<____(e)____;

(a) stud<=3
(b) cin>>
(c) mark++
(d) total
(e) total


2) Based on the short code below :
Change for loop statement below to while loop
for(x=1;x<=5;x++)
cout<<x<<"\t"<<x*2<<"In";

x=1;
while(x<=5)
cout<<x<<"\t"<<x*2<<"In";
x++

3) Write the code using while loop to get the output as below !
    20
    15
    10
    5
 
x=20
while(x<=5)
cout<<" "<<x;
x--;

Wednesday, March 9, 2011

we study about chapter FOUR

~ Arithmetic operators :
    + + (Unary Plus)
    - - (Unary minus)
    + (Addition)
    - (Substraction)
    * (multiplication)
    / (Floating-point division / Integer division)
    % (Modulus)
Dlm C++, ade increament nan decrement operator..
    + + (Pre-increment) e.g + +m
    + + (Post-increment) e.g m+ +
    - - (Pre-decrement) e.g - -n
    - - (Post-decrement) e.g n- -

Tips utk sng hfl : if simbol at dpn variable (Pre-), mest TAMBAH or TOLAK 1.. if simbol at blkng (Post-) xyah tmbah pe2..follow je blek soalan..
 
EXAMPLE
       a = 2 , b = 3
       m = 2 , n = 3
       p = 2 , q = 3
       x = 2 , y = 3            

(+ + a) + (- - b) * 4 > (+ + m) * (- - n) + 4

JAWAPAN :
               
2) Relational operators :
    < (Less than)
    > (Greater than)
    = = (Equal to)
    < = (Less than or equal to)
    > = (Greater than or equal to)
    ! = (Not equal to)

3) Logical operators : (0/False , 1/True)
    & & (AND) ----> IF 0 mest FALSE
    | | (OR) ----> IF DE 1 MEST TRUE
    ! (NOT) ---->IF 1, MEST 0..IF 0, MEST 1
    !(& &) (NOT AND) ----> MEST TBALEK KN  & &
    !(| |) (NOT OR) ----> jwpn tbalek nan | |
 EXAMPLE

Wednesday, February 23, 2011

Nie excercise yg miss bgi...huhuhhu....EXERCISE 2

Exercise 2 : QUESTION
Bahasa melayu=
Bahasa inggeris=
Matematik=
Sains=
Total=
Average=

Formula :
total=bm+bi+math+sains
average=total/4
ANSWER
#include<iostream.h>//header
main()//start body
{//open curly bracket
float bm;
float bi;
float math;
float sains;
float total;
float average;
//input 1
cout<<"bahasa melayu=";
cin>>bm;
//input 2
cout<<"bahasa inggeris=";
cin>>bi;
//input 3
cout<<"matematik=";
cin>>math;
//input 4
cout<<"sains=";
cin>>sains;
//formula
total=bm+bi+math+sains;
//output
cout<<"total="<<total;
//formula
average=total/4;
//output
cout<<"average="<<average;
return 0;
}//close curly bracket
//end body

Monday, February 21, 2011

register forummmmm.....2/2/11

alamak ade keje lgi...
kitorg kne wat step2 tok register forum....
gne print screen lgi.....
huhuhu.....bnyk keje seh....

STEP 1 go to all program >> internet explore



STEP 3 Register by click JOIN


STEP 4 click agree


 STEP 5 complete register information and save
 
STEP 6  Confirm your password and save
 
 
STEP 7 Check your yahoo ID and password
 
STEP 8 Click the link given
 
STEP 9 try login your forum to check
 
STEP 10
 
 
*huhuhu settle pun..tpi serabot gak auw nk wat...bab kene wat bnyk keje tau...smpai teslah2 aq wat tau...dh nk kne wat blek...tu yg wat kn serabot tu....