BLOGGER TEMPLATES AND TWITTER BACKGROUNDS

Wednesday, March 30, 2011

Assignment 1

Tin Minuman..

******************
MESIN TIN MINUMAN


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:_________________ Thank You!
Insert your money:__________________ Please come again.


*Your balance are:
*Please insert___







Step 1:

_______________ your money is










Step 2:











Step 3:
___________not enough balance.

If Else statement..

If else statement

#include




main()


{


//declare variable


int age;


//if else statement


if(age>=1 ll age<=6)


{cout<<"you are kids!;}


else if(age>=7 ll age<=12)


{cout<<"you are child babe!";}


else if(age>=13 ll age <=21)


{cout<<"you are teenager!";}


else if(age>=21 ll age<=30)


{cout<<"you are adult now!";}


else if(age>=30)


{cout<<"you are old,boo!";}


else


{cout<<"invalid selection";}


return 0;


}



switch...case statement.




#include




main()


{


//declare variable


int age;


//input


cout<<"enter your age=";


cin>>age;


//switch case statement


switch(age)


{case('age'>=1 ll 'age'<=6):cout<<"you are kids!";break;


case('age'>=7 ll 'age'<=12):cout<<"you are child beb!";break;


case('age'>=13 ll 'age'<=21):cout<<"you are teenage!";break;


case('age'>=22 ll 'age'<=30):cout<<"you are adult now!";break;


case('age'>=30):cout<<"you are old!";break;


default:cout<<"invalid selection";


}


return 0;


}

Saturday, March 26, 2011

Excercise 3

Find fahrenheit. 


Formula:
fahrenheit=(9/5)*(celcius+32)

ALGORITHM

1. Read the celcius of the fahrenheit.
2. Calculate fahreheit equals to nine divided by five, multiplied by celcius added thirty two.
3. Display fahrenheit.

 
PSEUDOCODE


1. Get celcius.
2. Set fahrenheit=(9/5)*(celcius+32).
3. Print fahrenheit. 

FLOWCHART



Excercise 2

Find the celcius

Formula:
celcius=(5/9)*(fahrenheit-32)

ALGORITHM 

1. Get the fahrenheit of celcius.
2. Calculate celcius equals to five divided by nine, multiplied by fharenheit minus thirty two.
3. Display celcius.
PSEUDOCODE

1. Read fahrenheit.
2. Set celcius=(5/9)*(fahrenheit-32).
3. Print celcius. 

FLOWCHART 


Excercise 1

Find the area of circle

Formula:
area=3.14*radius*radius

 ALGORITHM 
 
1. Get the radius of the circle.
2. Calculate the area equals to 3.14 multiplied by radius by radius.
3. Display the area.
 
PSEUDOCODE


1. Get radius.
2. Set area=3.14*radius*radius
3. Print output.





FLOWCHART 



FOP Chapter 1...

Kena buat soalan yg miss ayuni bagi.

Contoh 1
Find the area of rectangle

Area=width*height
  
 ALGORITHM

1. Get the width of the rectangle.
2. Get the height of the rectangle.
3. Calculate the area using the formula, area equals to width multiplied by     height.
4. Display the area of the rectangle.

PSEUDOCODE

1. Read the width.
2. Read the height.
3. Set the area to the width multiplied by height.
4. Print the area.

FLOWCHART