2023 2024 EduVark > Education Discussion > General Discussion


  #2  
December 5th, 2017, 07:49 AM
Super Moderator
 
Join Date: Mar 2012
Re: NMDC Computer Science Question Paper

As you are looking for NMDC Computer Science sample Question Paper, so on your demand I am providing same for you :


Question-1
1. (a) Define Multilevel and Multiple Inheritance with example . [ 2 Mark]

(b) Define a class ELECTION in C++ with the following descriptions: Write a suitable main ( ) function also to declare 3 objects of ELECTION type and find the winner and display the details .[ 4 Mark]
Private members :
Data : candidate_name , party , vote_received
Public members :
Functions: Enterdetails ( ) – To input data Display ( ) – To display the details of the winner Winner ( ) – To return the details of the winner trough the object after comparing the votes received by three candidates .

(c). Answer the questions (i) to (iv) based on the following code: [ 4 Mark]
class RED
{
char n [ 20 ];
void input ( );
protected :
int x , y ;
void read ( );
public :
RED ( );
RED ( int a );
void get_red ( );
void put_red ( );
};
class WHITE : protected RED
{
void a , b ;
protected :
int c , d ;
void get_white( );
public:
WHITE ( );
Void put_white ( );
};
class BLACK : private WHITE
{
void * p ;
char st[20];
protected :
int q;
void get_black( );
public:
BLACK ( );
void put_black ( );
}ob;

i. Name the data members and functions which are accessible by the objects of class BLACK.
ii. Give the size of object ob
iii. Name the OOPS concept implemented above and its type .
iv. Name the members accessible by function get_black( );

Question-2
2. (a) What do you understand by Data Encapsulation and Data Hiding? Also, give a suitable C++ code to illustrate both. [ 4 Mark]

(b) Answer the questions (i) and (ii) after going through the following class: [6 Mark]
class Seminar
{
int Time;
public:
Seminar() //Function 1
{
Time=30;cout<<“Seminar starts now”<<end1;
}
void Lecture() //Function 2
{
cout<<“Lectures in the seminar on”<<end1;
}
Seminar(int Duration) //Function 3
{
Time=Duration;cout<<“Seminar starts now”<<end1;
}
~Seminar()
//Function 4
{
cout<<“Vote of thanks”<<end1;
}
};
i) In Object Oriented Programming, what is Function 4 referred as and when does it get invoked/called?
ii) In Object Oriented Programming, which concept is illustrated by Function 1 and Function 3 together? Write an example illustrating the calls for these functions.

Question-3
3. (a) Write a function in C++ to merge the contents of two sorted arrays A & B into third array C. Assuming array A and B are sorted in ascending order and the resultant array C is also required to be in ascending order. [3 Mark]

(b) An array S[40][30] is stored in the memory along the row with each of the element occupying 2 bytes, find out the memory location for the element S[20][10], if the Base Address of the array is 5000. [3 Mark]

(c) Write a function in C++ to perform Insert operation in a dynamically allocated Queue containing names of students. [3 Mark]

(d) Write a function in C++ to find the sum of both left and right diagonal ele-ments from a two dimensional array (matrix). [3 Mark]

(e) Evaluate the following postfix notation of expression: 20, 30, +, 50, 40, – ,* [3 Mark]

Question-4
4. (a) Write a function in C++ to delete a name from a list of names. [4 Mark]

(b) An array A[13][14] is stored in the memory along the column with each element occupying 4 bytes. Find out the Base address and address of the element A[3][7] if the element A[4][4] is stored at the address 1300. [4 Mark]

(c) Consider the following portion of a program , which implements names queue for Books. Write the definition of function Insert(), to insert a new node in the queue with required information. [4 Mark]
struct Book
{
char names[4][20];
};
class QueueofBooks
{
Book Q[10];
public :
int front ,rear;
QueueofBooks()
{
front=rear=-1;
}
void Insert();
void Delete();


Quick Reply
Your Username: Click here to log in

Message:
Options



All times are GMT +5. The time now is 04:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.6.0

1 2 3 4 5 6 7 8