You are on page 1of 7

COMPUTER SCIENCE

(330)
Time : 3 Hours] [Maximum Marks : 60

Note : (i) Answer all questions.

(ii) Marks allotted to each question are given in the right-hand margin.

(iir) Use C++ programming language to answer the programming qucstions.

1. Define the following : 14xl=4,1


a) FTP

b) Sorting

c) Arithmetic Logic Unit

d) 'Iaskbar

2. a) Describe thc functions of the following input devices: 1,3x2=6il


i) Keyboard

ii) Scanner

iii) Mouse

b) Explain the Data processing Cycle. 12;l

c) Classify Computer Language. lzil


d) I)iscuss Digital 'fransmission and Analog 'l'ransmission. 1,27

s6/ossfl-330-AI G-73 2 I lllil llill lltl ll llil ilil illl illl il lfl lllil ffil lllil ilil llilill lllll r c.n,d
3. a) Name the header files to.which following built-in function belong :

1,2x1-2il
i) fabs 0
ii) strcat 0
b) Explain the following terms with example from C++. 12x2=41
i) Abstraction

ii) encapsulation

c) Write a C++ statement using Conditional Operator to display maximum


among three numbers a, b, c. 12;l

d) Explain syntax of while loop. l,2il

e) Write a function in C++ to calculate the sum of digits of an intcgral numbcr.


Lzl

4. a) What is thc differcnce between = and ==operator. Givc an examplc in support


of your answcr. 12;l

b) Find the syntax effor from the following program. Justify each crror. l2l
#include<iostream.h>

void display(float p)

cout<<"I'he argument is'((pl


)

void main( )

float g= 11.1;
display(p);

s6/oss/L-330-AI G-73 3 IContd......


!.j
:'
i

c) Write the output of ,the following program: t3l

#include<iostream.h>

int p=4;

void change(int &v, int n=l)

{
ililrilt lllilutililllilt ffi I illt H
v=v*n;

n=v--14;

void main0

int p*50, Q=10;

change(::p,q);

cout<<p< <" ####" <<q<<endl ;

changc(p);

cout<<p< <" ####" <<q<<cndl ;

changc(q, 10);

cout<< : p<<"####"<<q<<endl
: ;

d) Write a function VERIF-Y 0 in C++ that accepts a character as an argumcnt


and checks whether it is a digit or not. t3l

s6/ossft-330-Ar G-zs 4 llllililllililfrllffiililllllilillllillillllflllllllillilllil


rcontd
5. a) Predict the output of the following program : t21
# include<iostream.h>
# include<ctype.h>
# include<stdio.h>
void main0
t
char Text[ ]="#G02D"; fiilrffiffilililfiffi]mmIffifl
for (int i=0; Text[i]!=1\0'; i ++)
t
if (! isalpha(Text[i]))
Text[i] ='*'l
else

Textli] = Textli+ 1l;


)
puts(Text);
)
b) Define a class ISL with the following specifications : t3I
Private Members:
Match_index Numeric
Venue String
Date String
Teaml String
'leam? String
Public Members:
o I constructor that initializes all numeric members with 0 and all strings
with "ABC"
. Accept( ) _ that accepts the entire data
. Display( ) _ that displays the entire data

56/oSS17-330-AI G-73 5 IContd......


c) Consider the following class definition and answer the questions that follow.
t3I
class Toys

{
char toy_typellOl;
protected:
float price;
void cal_price(float);
public:
Toys( );
char choice;
void toyinput 0;
void toyshow0;
);
class MyToys : protected Toys

{
char mtoy_name[10];
float weight;
protected:
int no_wheels;
public:
void Mylnput 0;
);
i) Which type of inheritance is shown in the above example?
ii) Which all data members are accessible from Mylnput( )?
iii) Name the member functions which are accessible from the objcct of
class MyToys.
d) Write a program to find all numbers which are perfect square in an intcgcr.
affay of size 15. I3l

s6/ossrt-330-Ar G-rs 6 llllilllflilllllililffillllllfllllltrilffiillllffilllllffilillil rcontd


6. a) Which statement in C++ is used to create an alias of a datatypc. tl]
b) Declarc a structure ADDRESS having HouseNo(int), Locality(srring),
Street(string) and City(string) as its members. Thereaftcr crcate anothcr
structure ADMISSION having the following membcr's:

Adm_No of type integer


Name of type string
Category of type string
S_Address an instance of ADDRESS

Write a C++ statement to accept the value of Locality from the uscr. 12il

c) Givc a C++ statements to do the following : Lz]


i) Crcate an integer pointer ptr
ii) Make ptr hold the address of integer variable var.
d) Assuming the class HEALTH STATION defined below, write a user dcfincd
function to read the objects of HEALTH STATION from the binary filc
Hospi.dat and display the records of 'Cardiology' department. or of pcrsons
having name "XYZ". I3I
class IIEALTH STATION
t
int Paticnt_Id;
char Patient_Name[ 1 3] ;
cfar OPD_Datc[10]; l* ddlmmlyyyy *l
float fees;
char Deptl20l;
public:
void enterdata( )

{
s6/ossrt-330-Al G-78 z llllillffillillilililllilillllllllilillillfllffiilillllfllllillilllll rcontd
,gin>>P'a*ieat;Id;
gets(Patient-name);

gets (OPD-Date);

cin>>fees;
gets(Dept);

void showdataO'

cout<<Patient-Id<<Patient-Name<<OPD-Date<< fecs<<I)cpt;

char []gctdeptQ

t
return Dept;

char * getname0 iti I it i r ilil1ill illlllllllllIill til il1il

t
return Name;

);
e) Explain the two methods to open a data file in C++. I3l

ooo
To score better in nios and for good
percentage contact @ 9839065533 ,6386869080

56/ossn-330-Ar G-7s 8 llllilllfllillllllffiillilffilllll|llillffilffililflllllffililllilll

You might also like