Monday, 28 March 2011

WEEKLY REFLECTION 6


- seperti biase,kami diberi rehat selama 1 jam.
- PN.AYUNI telah memberi kami latihan yang Exercise Question Past Years.
- PN.AYUNI memberi tempoh kepada kami untuk menyiapkan tugasan dari pukul 10.00 hingga 12.00 tengahari.
.
-PN.AYUNI akan menyemak jawapan yang kami berikan..

-PN.AYUNI telah memberikan kami tugasan iaitu Assignment yang kedua-2 iaitu Membuat Sifat menggunakan coding (looping)..

contoh loop



WEEKLY REFLECTION 4

_seperti biase,kami diberi rehat selama 1 jam.

-selepas rehat,kami belajar chapter 4 iaitu operators and expressions.

-kami belajar ARITHMETIC OPERATORS,RELATIONAL OPERATORS,LOGICAL OPERATORS DAN ASSISMENT OPERATORS.

-Pn.Ayuni memberi kami exercise dan kami diberi tempoh selama 45 minit untuk menyiapkannya.

 - setiap group hendaklah menyiapkannya dan setiap wakil ahli group prelu membuat jawapan didepan.


CHAPTER 4 OPERATORS AND EXPRESSIONS.
4.1 Operators
-   C++ is very rich in built-in operators.
-  Operators triggers some computations when applied to operands in an expression.
- The commonly use operators are as follows :-
    a) Arithmetic Operators
    b) Relational Operators
    c) Logical Operators
    d) Assignment Operators

- Table 4-1 shows the commonly use operators in C++ programming language.

Arithmetic Operators
Relational Operators
Logical Operators
Assignment Operators
+
>

&&
=
-
<

||

*
>=
!

/
<=


%
==



INCREMENT AND DECREMENT OPERATOR

- Increment  -  Pro-increment   (++N)
                    - Post-increment  (N++)

- Decrement  - Pro- decrement   (--N)
                      - Post-decrement   (N--)
- For Example :-

 Int n ;                                                                            Int n ;
n = 5                                                                              N=5

cout << n, 5                                                                   cout << n, 5
cout << ++N ; 1+5 =6                                                    cout << N++ ;
cout << N ; 6                                                                 cout<< n ;  




Int M;                                                                                      Int M ;       
M= 9                                                                              M = 10
         
Cout << m; 9                                                                 cout << m ; 10
Cout << --M ; 8                                                             cout << M-- ; 10-1 =9
Cout << M ; 8                                                                cout << M ; 9


LOGICAL OPERATING

M
N
M&&N
M||N
0
0
0
0
1
0
0
1
0
1
0
1
1
1
1
1

!(M&&N)
!(M||N)
!M
!N
1
1
1
1
1
0
1
0
1
0
0
1
0
0
0
0


















! (M&&N) && (M||N)
!(M) || !(N)
1
1
0
1
0
1
0
0

For Example :-

++ a + --b * 4  > ++n  && p++ + q-- * 4 < x++ + 4

= 3 + 2 * 4 > 3* 2 + 4 &&      3 + 2 * 4 < 3 * 2 + 4
= 3 + 8 > 6 + 4            &&      3 + 8 < 6 + 4
= 11 > 10                     &&      11 < 10
=    1                            &&           0
                                      0

WEEKLY REFLECTION 5

   We learn c + + as usual and we were given tasks to complete the following exercises in the Forum.

Answers will be sent and attach it in the Forum. Each group must make discussion of cooperation to complete their assignment before the end of class.

Finally, as usual for the [/list]Weekly Reflection for the week.