miss ayuni time kasih sebab da ajar sye nari pasal assigment nie...
hehehhee
sye da try wat gk mule2 error lme2 ok da,,,hehehhe
belaja dr kesilapan,,,,
TQ MISS AYUNI.....
Sunday, March 27, 2011
dedicate 4 miss
Posted by Rita Ahmat at 4:32 AM 0 comments
assigment 2
assigment wat loop....
step 1
step 2
step 3
step 4
step 5
step 6
step 7
Posted by Rita Ahmat at 4:30 AM 0 comments
Saturday, March 26, 2011
exercise before exam
QUESTION 1
change the if....else statements below to switch.....case statements:
#include <iostream.h>
main()
{
int nom A,nom B,Selection,Value;
cout<<"enter 2 numbers:";
cin>>nomA >>nomB;
cout<<"1.addition";
cout<"2.subtraction";
cout<<"3.multiply";
cout<<"4.division";
cin>>selection;
{
if (selection ==1)
{value =nomA + nomB;}
else if (selection ==2)
{value =nomA - nomB;}
else if (selection ==3)
{value =nomA * nomB;}
else if (selection ==4)
{value =nomA / nomB}
else
cout<<"invalid selection";}
<<"the value is:"<<value;
}
ANSWER:
Posted by Rita Ahmat at 9:08 AM 0 comments
LOOP & WHILE
LOOP
#include <iostream.h>
main()
{
//declare variable
//get input
cout <<"enter an integer = ";
cin >> x;
//loop for
for (y=0;y<x;y++)
{
cout <<" "<<x;
}
WHILE
#include <iostream.h>
main()
int x.y;
cout<<"enter an integer =";
cin>>x;
//while
y=1;
while (y<x)
{
cout <<" "<<x;
y++;
}
}
Posted by Rita Ahmat at 8:29 AM 0 comments
LUAHAN PERASAAN
hari nie da abez exam tok mid term,,,,
lege rasenye,,,,tp penutup exm td paper FOP...
woooowww mmg xdpt nk skor,,,hahhaha
w'pown ms da bg clue tp xcnfdnt nk jwb....
xpela da try skg tinggal tawakal jewk,,,,
arinie sgt2 ont coz,,,abez jewk exam td troz g pustakaan cr bahan nk wt assgmnt MS...
pas ue smpai uma troz bkak laptop update blog....
wargggghhhhh pnt sgt2,,,,,
sok kls ag....hahahha
serius mmg pnt sgt2,,,,,
ok la time nnk tido,....
nite sume,,,:-)
Posted by Rita Ahmat at 8:19 AM 0 comments
assigment 1
write as program.
***************************
MESIN TIN MINUMAN
----------------------------------
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 mmoney is not enough !!!!!!:________________
THANK YOU!!!!
PLEASE COME AGAIN
CODING!!!!!!!!!!!!
STEP 1
STEP 3
STEP 4
STEP 5
STEP 6
STEP 7
STEP 8 : nie cth kalo xkurang duit
STEP 9
STEP 10
STEP 11
STEP 12
STEP 13: cth kurang duit
STEP 14
STEP 15
p/s tq 4 miss ayunie....kerana da ajar sye
Posted by Rita Ahmat at 8:12 AM 0 comments
JOM STDY IF...ELSE OR SWITCH CASE...
Posted by Rita Ahmat at 8:05 AM 0 comments
exercise 2
QUESTION 1:
a) intializing variable pi with the value 3.14
ans: float pi = 3.14
b) Declare a variable named parameter with double data type
ans: Double perimeter;
c) Give instruction that allowed user to input data
ans: cout<< "enter your data";
cin>> data;
d) Input number of computer using variable
ans:cout<<"enter number";
cin>>number;
QUESTION 2:
Change the if....else statement below to switch....case statement
#include <iostream.h>
main ()
{
int selection,quantity;
float price;
cout<<"1.pen = Rm0.50";
cout<<"2.pencil = Rm0.30";
cout<<"3.ruler = Rm0.20";
cout<<"4.eraser = Rm0.10";
cin>>selection;
cin>>quantity;
if (selection = =1)
{ price = quantity * 0.50;}
else if (selection = =2)
{ price = quantity * 0.30;}
else if (selection = =3)
{ price = quantity * 0.20;}
else if (selection = = 4)
{ price = quantity * 0.10;}
else
{ cout <<"invalid selection";}
cout<<"the price is : "<<price;
return 0;
}
ANSWER:
Posted by Rita Ahmat at 6:54 AM 0 comments
Sunday, March 6, 2011
exercise 1
1) Solve the equestion below solve the following :
a) 5 * 2 % 3 + 25 / 5
! ((a<3) && (a = = 3) ll (b > a)
2) identify the syntax errors in the following program
include <iostream.h>
mai ()
{
float allowance = 300.00 salary;
cout <<"input salary = ";
cin >salary;
Tsalary = salary + allowance;
cout <<"salary is = <<salary;
}
3)write a program that will calculate the monthly salary for an employee that where saturday & sunday are considered as non working days.
nie yg da wat programming:
4)write a program that allowance their average of 5 numbers that can be input by user.
answer:
#include <iostream.h>
main()
{
float no1;
float no2;
float no3;
float no4;
float no5;
float total;
float average;
//input 1
cout <<"num 1";
cin>> no1;
//input 2
cout<<"num 2";
cin>>no2;
//input 3
cout<<"num 3";
cin>>no3;
//input 4
cout<<"num 4";
cin>>no4;
//input 5
cout<<"num 5";
cin>>no5;
//formula
total = no1 + no2 + no 3 + no 4 + no 5
//output
cout <<"total"<<total;
//formula
average = total/5;
//output
cout<<"average"<<average;
return 0;
}
nie yg da jd wat programming
5)write a program that will calculate the area of rectangular,triangle and circle:
answer:
#include <iostream.h>
main ()
{
//declare variable
float height;
float weight;
float area_rectangle;
float radius;
aloat area_circle;
float area_triangle;
//input 1
cout<<"enter height";
cin>>height;
//input 2
cout <<"enter weight";
cin>>weight;
//input 3
cout<<enter radius";
cin>>radius;
//formula 1
area_rectangle = height * width;
//output 1
cout<<"area_rectangle ="<<area_rectangle;
formula 2
area_circle = 3.14 * radius * radius;
//output 2
cout <<"area_circle ="<<area_circle;
//formula 3
area_triangle = 0.5 * height * height;
//output 3
cout<<"area_triangle ="<<area_triangle;
return 0;
}
nie yg da jd wt programming
ok da siap pown...pnt glew wt nie...hehehehe
Posted by Rita Ahmat at 8:59 PM 0 comments