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:
Wednesday, March 30, 2011
Assignment 1
Posted by Azuwan at 8:15 PM 0 comments
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;
}
Posted by Azuwan at 7:52 PM 0 comments
Saturday, March 26, 2011
Excercise 3
Formula:
fahrenheit=(9/5)*(celcius+32)
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
2. Set fahrenheit=(9/5)*(celcius+32).
3. Print fahrenheit.
Posted by Azuwan at 5:16 PM 0 comments
Excercise 2
Formula:
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.
Posted by Azuwan at 5:08 PM 0 comments
Excercise 1
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.
Posted by Azuwan at 4:56 PM 0 comments
FOP Chapter 1...
Kena buat soalan yg miss ayuni bagi.
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.
2. Read the height.
3. Set the area to the width multiplied by height.
4. Print the area.
Posted by Azuwan at 4:40 PM 1 comments