Professional Documents
Culture Documents
Sem 2 1516
Sem 2 1516
Sem 2 1516
CONFIDBNTIAL
UTHM
Unlversltl filn Husseln Onn fHalapla
FINAL EXAIVIINATION
SEMESTERII
sEssroN 20rst2016
CONFIDENTIAL
a\
,l
SECTION A
Int main 0
{
const double G:9.81;
double weighg mass
cout
cin
weight-mass*G
cout << "The weight of this object is" ( weight
return 0;
)
CONFIDENTIAL
CONT'II}ENTIAL BFC 20802
SECITON B
Q2 Sfiate utheltcr fu fonowing vuiable nme are valid c invati4 If thcy are invalid, state
the reason.
(6 madrs)
\. I
a4 Cmverttbfolburing jf statmttoflowchart
(5 ma*s)
if (x::f )
cout((xi
else
cout((Y
1- / lPxogram 2
2 #include <iostem>
3 #include (iomanip>
4 using namespace std;
5 int nain ( )
6{
7 double numL, numz total;
B numL : 3;
9 num2 : L.32;
L0 total : numl + numz
11- cout
L2 cout
13 return 0;
L4
4
CONIII}ENTIAL
CONFIDENTIAL BFC 2A802
(1 mark)
(1 mark)
(l ma*)
(d) Inpr$ fonintegervahs fim frc keybord i6s integervriables q b, c andd"
(l mark)
(l mark)
CONFIDENTIAT
CONFIDENTIAL BFC 2A802
Q8 Based on the given flowchart identifr the output of the average of odd numbers from I
to 9. Construct the algorithm based on the flow chart.
(10 marks)
a9 Define the conditional statement and give a suitable example for it.
(5 marks)
Q10 write a c.* program to find the output of the following series:
xn
sum:R-d-*.tt**,'*
'
5! 7!'9l '(n+ZI
(10 marks)
CONF'IDENTIAL
CONFIDBNTIAL BFC 20802
SECTION C
Qr1 Conshrct a flowchart and write a complete Cr-+ code which will ask user to key in the
pH level of a wats sample to find out its pH range and biological effwts according to
Teble I to decid€ whether a solution is very acidig acidig neutaf alkaline or v€ry
alkaline.
(30 marks)
(30 marks)
-Ehln oFQUESTIONS-
7
CONTIDENTIAL
f{
I
.ita
Ir
Tebb I
ptrrrge Ilrpc of solrtion @|crtcffotcs
0-2 Veryacidic Allfisdtu
3{ Acidic mostfiSdie
7 Neuhal Qptimrm formmtfish
t-l I Alkaline Mo$fiSdi€
12-14 Veryatkalire AllfiSdie
Trb'b2
LOAI{ INFORMATION:
CONTr'II}ENTIAL