Professional Documents
Culture Documents
com
[1111 Ri&hts ~~J
I I!~~!!mrrE
® , ,. . . . ._In_ . . . . . . OF ADVANCED TECHNOlOG'~"DUW'ON
"' w..'-,,............... _In ........ '/'!IN I!I'I ~I
~) What is meant by tenns source code and ObjIXI code in programming? 104 Marks]
d) What is the expected o utput of the following pseudo code? 102 Mar ks1
Begin
X= l
While X< IO
X: X+ t
End while
Display X
Eoo
e) Write pseudo codes to inpullwo numbers and display Ihe smaller ollC. 104 Marks]
I. Declare a eonSlanl
I. number=numbt-r+ 12
II . number=number"% 12
@ cou\« (10+20);
cout«(O IO):
couI«(OIO+ IO):
eou\« (OIO+O IO):
[09 Marks ]
[Total Marks 20]
(3) a) Mention the reasons for the following error messages? 109 Marks]
in t Iirst"" IO,5crond"'20;
if (fi rst>sccond)
cout«"FlRST":
,''''
cout«"SECOND":
d) Write a c++ program to in[)U t a~>e ora person and display the relellant result according
to the follollling criteria. [06 Marks1
Age<-3 ~ Free
,
IINDIT . IT looJ h"rotfuclion 10 P'/lg'(j"'mln1f(N~) 200
www.hnditmediaunit.com
(4) a) What is the role ofllinclude direct ive in e++? 102 Marksl
/
b) What is the difference between local and global variables? (03 Marksl
lIinciude <iostream.h>
int x:
void mai nO
I
float y;
fOf(in t z=O;z<IO;z++)
cou t«x;
~BrieflY explain the use of defa ult arguments in a function. C02 Marks l
f) Write and test the following function that rctums the minimum value of the 3 integers
(5) a) Write syn tax of while loop and do while loop. [04 Marks l
e) What is the expected output oflhe following code fragment? 103 Marksl
while(20)
I
Cou\«"SL IATE";
######
#####
.'"
####
#
frotal Marks 201
I. Declare an array called " marks" of typc ·'int" and that should be able to hold 10
valucs.
II. Output the value oftcnth element of array "Number". 102 Marks]
III . Sct the value of fifth elemcnt of array "Numbcr" to 25. (02 Marks]
IV . Sctthe value of ninth element of the array "Nu mber·' to the sum of sixth and seventh
V, Set the value of the fou nh clement of the array "Number'· to three times the value of
VI. Output array "Number" so that five elements per line are printed. [05 Marks]
b) What operator is used to determine the addrcss ofa va riable? [02 Marks]
c) Suppose that you have a int pointer variable calted "x", Write statement that prints the
e) Write a program that take a character as an input and print the relevant word according to
if the character is
A - Apple
B - Banana
G - Grapes
o -Orange
M - Mango
An y other character - " Incorrect InpuC
[Total Marks 201
, a) What is the use of pri vate and public members in a class? 104 Marks]
b) Define a class called 'Student' wi th ·stu·number', ' name' and 'age' as attri butes and
'setDate' and 'printOata' as fu nctions to input data and output data respectively,
[06 Marks]