CS Mock (3) 2020-01-12: (I) Puts (Ii) Randomize (Compartment-2009)
CS Mock (3) 2020-01-12: (I) Puts (Ii) Randomize (Compartment-2009)
Condition Type
XUnit = 0 Or YUnit = 0 None
XUnit is more than YUnit Bar
XUnit is less than or equal to YUnit Line
Public members:
InXY() /* Function to allow user to enter values of XUnit and YUnit and
then invoke AssignType() to assign value of type */
OutXY() /* Function to display XUnit ,YUnit and Type */
[Out Side Delhi-2019]
(d) Answer the questions (i) to (iv) based on the following : 4
class First
{
int X1;
protected:
float X2;
public:
First();
void Enter1();
void Display1();
};
void main()
{
Third T; //Statement 1
__________________; //Statement 2
}
i)Which type of Inheritance out of the following is illustrated in the above example?
-Single Level Inheritance, Multilevel Inheritance, Multiple Inheritance
ii)Write the names of all the member functions, which are directly accessible by the object T
of class Third as declared in main() function.
iii) Write Statement 2 to call function Display() of class Second from the object T of class
Third.
iv) What will be the order of execution of the constructors, when the object T of class Third
is declared inside main()? [Out Side Delhi-2017]
Q.3. (a) Write a definition for a function SUMMIDCOL(int MATRIX[][10],int N,int M) in
C++, which finds the sum of the middle column’s elements of the MATRIX (Assuming N
represents number of rows and M represents number of columns, which is an odd integer).
Example: if the content of array MATRIX having N as 5 and M as 3 is as follows: (2)
1 2 1
2 1 4
3 4 5
4 5 3
5 3 2
The function should calculate the sum and display the following:
Sum of Middle Column: 15 [Out Side Delhi-2017]
(b) Write the definition of a function Modify(int A[], int N) in C++, which should reposition
the content after swapping each adjacent pair of numbers in it. (3) [Compartment-2015]
[NOTE : ASSUMING the size of array is multiple of 4 ]
for example, If array of 8 integers is as follows
A[0] A[1] A[ 2] A[3] A[4] A[ 5] A[6] A[7]
86 93 40 36 52 21 70 10
After executing the functions, the array content should be changed as follows:
A[0] A[1] A[ 2] A[3] A[4] A[ 5] A[6] A[7]
40 36 86 93 70 10 52 21
(c) Let us assume P[20][30] is a two-dimensional array, which is stored in the memory along
the column with each of its elements occupying 2 bytes, find the address of the element
P[3][5], if the address of the array is 45000. 3
OR
Let us assume P[10][20] is a two-dimensional array, which is stored in the memory along the
row with each of its elements occupying 2 bytes, find the address of the element P[5][10], if
the address of the element P[2][15] is 25000. [Compartment-2019]
(d) Write a function in C++ to delete a Node containing customer's information, from
dynamically allocated Queue of customers with the help of the following structure : (4)
struct Customer
{
int CNo;
char CName[20] ;
Customer *Link ;
} ; [Out Side Delhi-2007]
(e) Convert the expression (True && False) OR NOT(False OR True) to postfix
expression. Show the contents of the stack at every step. (2) [Delhi Board-2001]
Q.4. (a) Write a function in C++ to count the words "this" and "these" present in a text file
"ARTICLE.TXT". (2)
[Note that the words "this" and "these" are complete words] [Delhi Board-2010]
(b) Write a definition for function ONOFFER() in C++ to read each object (3)
of a binary file TOYS.DAT, find and display details of those toys, which has status as “ON
OFFER”. Assume that the file TOYS.DAT is created with the help of objects of class TOYS,
which is defined below :
class TOYS
{
int TID;
char Toy[20],Status[20];
float MRP;
public:
void Getinstock()
{
cin>>TID;
gets (Toy);
gets(Status);
cin>>MRP;
}
void View()
{
cout<<TID<<":"<<Toy<<":"<<MRP<<":"<<Status<<endl;
}
char *SeeOffer(){return Status;}
}; [Out Side Delhi-2016]
(c) Observe the program segment given below carefully and answer the question that
follows : (1)
class Labrecord
{
int Expno ;
char Experiment [ 20 ];
char Checked ;
int Marks ;
public:
// Function to enter Experiment details
void EnterExp();
// Function to display Experiment details
void ShowExp();
// Function to return Expno
char RChecked(){return Checked ; }
// Function to assign marks
void AssignMarks( int M )
{
Marks = M ;
}
};
void ModifyMarks( )
{
fstream File;
File.open("MARKS.DAT" , ios::binary |ios::in | ios::out );
Labrecord L ;
int Rec = 0 ;
while(File.read((char *)&L, sizeof(L)))
{
if(L.RChecked() == 'N' )
L.Assignmarks(0) ;
else
L.Assignmarks(10) ;
____________________ ; //statement 1
____________________ ; //statement 2
Rec++ ;
}
File.close();
}
if the function ModifyMarks() is suppose to modify Marks for the record in the file
MARKS.DAT based on their statusof member Checked (Containing value either 'Y' or 'N').
Write C++ statements for the statement 1 and statement 2, where statement 1 is required to
position the file write pointer to an appropriate place in the file and statement 2 is to perform
the write operation with the modified record. [Out Side Delhi-2007]
Q.5. (a) Observe the following table A and B carefully and write the name of the RDBMS
operation out of
(i) INTERSECT (ii) PROJECTION (iii) UNION (iv) CARTESIAN PRODUCT,
which has been used to produce the output as shown in RESULT ?Also, find the Degree
and Cardinality of the RESULT. (2) [Question Bank-2001]
Table A
column 1 column 2
A A
A B
Table B
column 1 column 2
A A
A C
RESULT
column 1 column 2
A A
(b) Consider the following relations MobileMaster & MobileStock:- 6
MobileMaster
M_Id M_Company M_Name M_Price M_Mf_Date
MB001 Samsung Galaxy 4500 2013-02-12
MB003 Nokia N1100 2250 2011-04-15
MB004 Micromax Unite3 4500 2016-10-17
MB005 Sony XperiaM 7500 2017-11-20
MB006 Oppo SelfieEx 8500 2010-08-21
MobileStock
S_Id M_Id M_Qty M_Supplier
S001 MB004 450 New Vision
S002 MB003 250 Praveen Gallery
S003 MB001 300 Classic Mobile Store
S004 MB006 150 A-one Mobiles
S005 MB003 150 The Mobile
S006 MB006 50 Mobile Centre
Write the SQL query for questions from (i) to (iv) & write the output of SQL command for
questions from (v) to (viii) given below:-
(i) Display the Mobile company, Mobile name & price in descending order of their
manufacturing date.
(ii) List the details of mobile whose name starts with ‘ S ’ .
(iii) Display the Mobile supplier & quantity of all mobiles except ‘MB003’.
(iv) To display the name of mobile company having price between 3000 & 5000.
(v) SELECT M_Id, SUM(M_Qty) FROM MobileStock GROUP BY M_Id;
(vi) SELECT MAX(M_Mf_Date), MIN(M_Mf_Date) FROM MobileMaster;
(vii) SELECT M1.M_Id, M1.M_Name, M2.M_Qty, M2.M_Supplier FROM MobileMaster
M1, MobileStock M2 WHERE M1.M_Id=M2.M_Id AND M2.M_Qty>=300;
(viii) SELECT AVG(M_Price) FROM MobileMaster; [Question Bank-2018]
Q.6. (a) Verify X'Y + X.Y' + X'Y' = (X' + Y' ) using truth table. (2) [Delhi Board-2009]
(b) Write the equivalent Boolean Expression for the following Logic Circuit : (2)
[Delhi Board-2017]
(d) Reduce the following Boolean Expression using K-Map : (3)
F(A,B,C,D) = ∑(0,1,2,3,4,5,10,11,15) [Out Side Delhi-2005]
Q.7. (a) Write one name of wireless and one wired communication medium. 2
[Compartment-2017]
(b) Dr. Theekkar Singh is a very experienced orthopaedician in the Ilaj Nagar City. He is
planning to connect 5 of his clinics of the city with a personalised application for his
appointment organization without using mobile/web application. Which out of the following
networks would be suitable ? 1
(i)PAN (ii) LAN (iii)MAN (iv)WAN [Compartment-2019]
(c) What do you understand by a backbone of a network? (1)
OR what is CLOUD COMPUTING? [Delhi Board-2001]
(d) Expand the following terminologies : (2)
i) XML ii) WWW iii) WLL iv) TCP/IP [Out Side Delhi-2007]
(e) INSTITUTE OF DISTANCE LEARNING is located in PUNE and is planing to go in for
four wings for better interaction. The details are as shown below : (4) [Compartment-2009]
Student Lib
Wing Wing
Admission Admin
Wing Wing