Thursday, April 7, 2011

PEMBETULAN UNTUK MIDTERM

SECTION A

2.INT
3.FOR
4.i
5.i++
6.i
7.price
8.total
9.price
10.total

SECTION B

1.a) -string
       -float
       -float
       -strng
       -float

QUESTION 2

//include<istream.h>
main()
cout<<******menu******
cout<<"/n1.adition/n2.substract/n3.multiply/n4.division";
cout<<"/n******";
cout<</n/nyour selection=";
cin>>selection;
cout<<"/nenter two integer numbers=";
cin>>num1>>num2;
switch (selection)
{
case1:ans=num1+num2";
case2:ans=num1-num2";
case3:ans=num1*num2";
case4:ans=num1/num2";
default:cout<<"selection invalid!";
}
cout<<:your selection is"<<selection<<"and the answer is"<<ans"
return 0;
}

QUESTION 3

a)
 //include<iostream.h>
main()
{
int x,y=2;
while
x=1;
while(x<=5);
}
cout<<" "<<x*y;
x++
return 0
}
}