laalalalalaaaa.....ermmmm ok lah.....ermmm.....bad ahhh.........ermmmmm better kot.....ermmmm entah ahhhh.........bleyyyy kee...?????ermmm xpast ahhhh.......suke keeee.....errrmmmm not sure ahhhh......apppyyyy.....?????errrrm maybe.........emmm tah ah smue nye x past.......FOP aaaaaaaaaaa mybe.......errrrmmmm boley ahhhh.....ngeeeeee.....pening ea....????jgn bace ah......BORING...?????
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 6 :
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 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--;
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
Subscribe to:
Posts (Atom)