2015 – COMPUTER SCIENCE AND APPLICATION (Theory)
Full Marks: 70 Time: 3 hours
Answer the following questions: (1×10=10)
(a) What is identifier?
(b) What is the difference between == and = in C++?
(c) How does a class enforce data-hiding in C++?
(d) Write one property of static data member.
(e) What is visibility mode?
(f) Explain scope resolution operator (::) in C++.
(g) What is Queue?
(h) What are the two searching techniques available in data structure?
(i) What is Computer Network?
(j) Explain bandwidth.Explain the following questions: (2×10=20)
(a) How while loop is different from do-while loop?
(b) What will be the value of the following program segment?
for (i = 10; i <= 40; i += 10)
{
k = i / 2;
printf("%d\n", k);
}
(c) Differentiate between the following two statements (assume ‘time’ is class name and having parameterized constructor):
time T1(10, 20, 30);
time T1 = time(30, 20, 10);
(d) What is the difference between public and private members of a class?
(e) Write programming statements for the following class:
class bankaccount
{
int accno;
public:
bankaccount(bankaccount& p) // constructor 1
{
accno = p.accno;
}
bankaccount(int p) // constructor 2
{
accno = p;
}
};
(i) Create an object such that it invokes constructor 1.
(ii) Create an object such that it invokes constructor 2.
(f) Write a class definition called string with two private data members length and name of type int and char respectively. There are two public member functions getdata() and display() and one constructor.
(g) State two conditions under which Binary Search is applicable.
(h) Consider the following stack of characters implemented as an array of 8 elements:
STACK: A J P N _ _ _ _ (top at N)
Describe the stack if the following operations take place:
(i) POP(STACK, ITEM)
(ii) PUSH(STACK, K)
(i) Explain the concept of Bus Network Topology with a block diagram.
(j) Write two advantages of STAR topology.
(a) Draw a flow chart to read a number and find the sum of the digits.
(b) What will be the output of the following program segments?
main()
{
int j = 0;
while (j <= 30)
{
cout << j++ << "\n";
j += 3;
}
}
(c) Write a program in C++ to input a number through the keyboard and then to reverse the number and to print it.
(a) Find the syntax error(s), if any, and correct it. (Underline the corrected statement.)
class contest
{
int x, y;
contest() {}
contest() { x = 10, y = 20 }
void disp()
{
cout << x << y <<
}
};
main()
{
contest a;
a.disp();
}
(b) Consider the following class declaration and answer the questions below:
class AUTHOR
{
char aname[30]; int aid;
public:
void read();
void show();
};
class PUBLISHER : public AUTHOR
{
protected:
char pname[30];
public:
void getpublisher();
void disppublisher();
};
class BOOK : public PUBLISHER
{
int bookcode;
char bname[30];
public:
void getbook();
void dispbook();
};
(i) Name the data members which can be accessed from the member functions of class BOOK.
(ii) Name the data members and member functions which can be accessed by an object of class PUBLISHER.
(c) Define a class to represent a STUDENT with the following members:
Private: rollno, name, marks of MIL, English, Physics, Chemistry, Maths, total
Public: readdata(), calculate(), disp()
(d) Write a program in C++ to print the factorial of a given number using a constructor.
Or
Write a C++ program to generate the following series of numbers:
0 1 1 2 3 5 8 … N
(e) What is reference variable?
Or
What is data encapsulation?
(a) Write the steps to search 34 using Binary Search in the following array A[7]:
80 70 60 50 40 34 30
Or
Write a program in C++ to implement Binary Search algorithm for N numbers stored in an array.
(b) Write an algorithm to insert an ITEM of information at Kth position in a single dimensional array A[UB] where K < UB. The number of elements currently stored in the array is N.
Or
Explain Best Case time complexity of insertion or bubble sort.
(c) Define TOP.
Name different layers of OSI reference model.
Or
Describe the three basic types of cables.
❍❍❍❍
Also Read
![ASSEB Class 12 Computer Science Question Paper 2015 [HS 2nd Year Computer Science and Application Papers]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6z3kGyFFZV5CkTMboxlGY3EyitBPhc-ntpcDjajmkQd4DbSkSyr5mi9owliloUkfH3XywLipOCpMhWmkC7-9ngFZ3FeRUFp-FHE4iAREp9lS4dEEDSClmCTJYLeQtvbPa81ubR1qWOS0iIQrb_ElbNsQO3IhKKDFLsUwDwDfk8SGYtC6NcGaIScFDEemg/s16000-rw/ASSEB%20Class%2012%20Computer%20Science%20Question%20Paper%202015.webp)