Question 1. Write The
Question 1. Write The
write the
syntax to create a two
dimensional array
dynamically........?
Question 5. 20,30,+,50,40,-,*
Answer:
500
Question 6. Define the term Data Abstraction in the context of Object
Oriented Programming. Give a suitable example using a C++ code to
illustrate the same.
Answer:
When class contains objevts of other class types as a member.
Question 10. What do you understand by the terms Cookies and Firewall ?
Answer:
Cookies: A small piece of information that a server sends to a client When
you visit a Web site with cookie capabilities, its server sends certain
information about you to your browser, which is stored on your hard drive
as a text file. At some later time (such as returning to the site the next
day), the server retrieves the cookie. It’s a way toi the server to remember
things about you.
Question 11. What is the difference between XML and HTML ? Write two
differences.
Answer:
eXtensible Markup Language: It contains user defined tags
Hyper Text Markup Language: It contains predefined tags
(i) HTML
(ii) GSM
Answer:
Hyper Text Markup Language
Global System for Mobile communication
Question 13. What do you understand by the terms Candidate Key and
Cardinality of a relation in relational database ?
Answer:
Candidate Key: The attribute (Column) or set of attributes (Columns) which
can identify a tuple/row uniquely are known as Candidate Key(s).
OR
Candidate Key: The attribute (Column) or set of attributes (Columns),
which are capable of acting as candidate for primary key.
Question 14. Write a function in C++ to count and display the number of
lines not starting with alphabet ‘A’ present in a text file ‘STORY.TXT”.
Example :
If the file “STORY.TXT” contains the following lines,
The rose is red.
A girl is playing there.
There is a playground.
An aeroplane is in the sky.
Numbers are not allowed in the password.
Answer:
Evaluate : 20 10 + 5 2 * – 10 /
Answer is ((20+10)-(5*2))/10=2.
So, the value for the postfix expn. 20 10 + 5 2 * – 10 / is 2.
Question 16. Write a function in C++ to print the sum of all the values
which are either divisible by 3 or are divisible by 5 present in a two
dimensional array passed as the argument to the function.
struct Node
{
float U,V;
Node *Link;
};
class QUEUE
{
Node *Rear,*Front;
public:
QUEUE(){Rear=NULL;Front=NULL;}
void INSERT();
void DELETE();
~QUEUE();
};
Question 18. An array Arr[35][15] is stored in the memory along the row
with each of its element occupying 4 bytes. Find out the base address and
the address of an element Arr[20][5], if the location Arr[2][2] is stored at
the address 3000.
Answer:
4092
Question 19. Write a function in C++ which accepts an integer array and
its size as arguments/parameters and exchanges the values of first half
side elements with the second half side elements of the array.
Example :
If an array of eight elements has initial content as
8, 10, 1, 3, 17, 90, 13, 60
The function should rearrange the array as
17, 90, 13, 60, 8, 10, 1, 3
Question 20. Define the term Data Encapsulation in the context of Object
Oriented Programming.
Give a suitable example using a C++ code to illustrate the same.
Answer:
(i) stdio.h
(ii) ctype.h
Question 21. Name the header files to which the following belong :
(i) puts ( )
(ii) isalnum ( )
Answer:
Answer :
(i) stdio.h
(ii) ctype.h
Answer:
Default Constructor: It is type of constructor, which does not have any
parameter.
OR
OR
class STUDENT
{
int Rno;
char Name[20];
public:
STUDENT(); //Default Constructor
STUDENT(STUDENT &S); //Copy Constructor
:
:
};
Question 23. Write two application of Cyber Law
Answer:
TCP/IP:-Transmission Control Protocol/Internet Protocol
XML:-eXtensile Markup Language
CDMA:-Code Division Multiple Access
WLL:-Wireless in Local Loop
Question 26. What do you understand by the terms Primary Key and
Degree of a relation in relational database?
Question 27. Write a function in C++ to count and display the number of
lines starting with
alphabet ‘A’ present in a text file “LINES.TXT”.
Example:
If the file “LINES.TXT” contains the following lines,
A boy is playing there.
There is a playground.
An aeroplane is in the sky.
Alphabets and numbers are allowed in the password.
10 20 + 25 15 - * 30 /
Answer:
i think it as
::
30 *10/30
300/30= 10
Question 29. Write a function in C++ to print the sum of all the values
which are either divisible by 2 or are divisible by 3 present in a two-
dimensional array passed as the argument to the function.
Answer:
ans::3376
Question 31. Write a function in C++ which accepts an integer array and
its size as
arguments/parameters and exchanges the values of first half side elements
with the second half side elements of the array.
Example:
If an array of eight elements has initial content as
2,4,1,6,7,9,23,10
The function should rearrange the array as
7,9,23,10,2,4,1,6
Private Members:
Public Members:
A constructor to assign initial values of Plan Code as 1001, Place as “Agra”,
Number_of_travellers as 5, Number_of_buses as 1
A function NewPlan( ) which allows user to enter PlanCode, Place and
Number_of_travellers. Also, assign the value of Number_of_buses as per
the
following conditions :
Number_of_travellers Number_of_buses
Less than 20 1
Equal to or more than 20 and less than 40 2
Equal to 40 or more than 40 3
Question 33. Define the term Data Hiding in the context of Object
Oriented Programming. Give a
suitable example using a C++ code to illustrate the same.
Answer:
Answer (a)
Call by value :
The formal parameter makes a copy of actual parameter. It does not make
the changes in actual parameter if the changes are done in formal
parameters.
Call by reference :
The formal parameter is an alias of actual parameter. The changes made in
the formal parameter are reflected in actual parameter. It is preceded by &.