0% found this document useful (0 votes)
29 views4 pages

Preboard 2nd Year

This document is an examination paper for Computer Science HSSC-II from Brainstorm Academy, consisting of multiple sections including multiple-choice questions, short answer questions, and programming tasks. Section A is compulsory with questions related to programming concepts, while Sections B and C require more detailed responses and programming exercises. The total marks for the exam are 62, and students are instructed to write their answers in designated spaces.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views4 pages

Preboard 2nd Year

This document is an examination paper for Computer Science HSSC-II from Brainstorm Academy, consisting of multiple sections including multiple-choice questions, short answer questions, and programming tasks. Section A is compulsory with questions related to programming concepts, while Sections B and C require more detailed responses and programming exercises. The total marks for the exam are 62, and students are instructed to write their answers in designated spaces.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

FLP 2ND YEAR FULL BOOK

Brainstorm Academy G-10 Headoffice


COMPUTER SCIENCE HSSC–II
SECTION – A (Marks 13) Time allowed: 20Minutes.
Section – A is compulsory. All parts of this section are to be answered on this page and
handed over to the Centre Superintendent. Deleting/overwriting is not allowed. Do not
use lead pencil.
Q.1 Fill the relevant bubble for each part. All parts carry one mark.
S# Question (A) (B) (C) (D) (A) (B) (C) (D)
The default mode for ios::out ios::ate ios::app
(i) ios::in ⃝ ⃝ ⃝ ⃝
ofstream is
After completing I/o process
(ii) new Ready running Block ⃝ ⃝ ⃝ ⃝
go to __ state
Protected data members Inside Outside Inherited
(iii) None ⃝ ⃝ ⃝ ⃝
cannot be accessed class class class
It adds and assigns the
(iv) + += ++ >= ⃝ ⃝ ⃝ ⃝
value
for(n=20;n>=1;n/=3) 20 15 10 no
(v) { cout<<n;} 20 6 2 620 ⃝ ⃝ ⃝ ⃝
5 output
(vi) A constructor does not have arguments name returntype All ⃝ ⃝ ⃝ ⃝
(vii) We do not need to call a constructor destructor both None ⃝ ⃝ ⃝ ⃝
(viii) Function having same name overriding overloading definition call ⃝ ⃝ ⃝ ⃝
but different arguments
Variable that can be
(ix) accessed anywhere in local static global dynamic ⃝ ⃝ ⃝ ⃝
program
(x) Data members are by default public private protected none ⃝ ⃝ ⃝ ⃝
(xi) It is used to input a string cin gets puts getch() ⃝ ⃝ ⃝ ⃝
int x = 5;
(xii) cout<<++x<<x++<<x; will give 567 566 667 668 ⃝ ⃝ ⃝ ⃝
the output
& operator is called
______operator
(xiii) reference And OR none ⃝ ⃝ ⃝ ⃝

*******************
Student’s Name:___________________________________________________ Roll No.________________

II
Time allowed: 2:40 hours Total Marks: 62
Note: Answer all parts from Section ‘B’ and all questions from Section ‘C’ on the E-sheet. Write
your answers on the allotted/given spaces.

SECTION – B (Marks 42)

Q.2 Attempt any FOURTEEN parts from the following. All parts carry equal marks. (14× 3 = 42)
i. What is constructor? Discuss its characteristics.
OR
How can we create object of a class and access its member function.
ii. What is array? how it is declared?
OR
Briefly discuss escape sequence.
iii. Write a program that input ten numbers in an array and print their squares and cubes.
OR
Write a program that reads two numbers and find the power of first number to the second
number.
iv. What is the purpose of default statement in switch?
OR
Give a comparison between else if and switch.
v. Differentiate between functional and nonfunctional requirements.
OR
Differentiate between single user and multiuser operating system.
vi. Differentiate between for loop and while loop.
OR
Write a program that reads a number and check if it is divisible by 5 and 3 both.
vii. How arrays are initialized? Write an example
OR
What is nested if.
viii. Trace the output of following code……………….. Int a=10,b=5;
Or what is destructor? Can we overload it? Int c = ++a*b - -;
ix. What is the use of gets and puts? Cout<<a<<b<<c;
OR
What is the difference is between postfix and prefix increment operator.
x. Differentiate between getch() and getche().
OR
Briefly discuss the use of modulus operator in c++ with example.
xi. What is polymorphism ?give example
OR
What is type casting? Name its types.
xii. Write a program, that input a number and find its square if it is greater than 10 otherwise find
its cube.
OR
Write a program that input a number and tell whether it is even or odd.

*************
P.T.O
#include<stdio.h>
xiii. Point out the errors in the following code…
OR……………………………….. Void main()
Write a program that reads a number and find its square root. {
xiv. How files are manges by the opeating system.? float a =10.5;
OR int b = 5.7;
What is batch processing system? cout<<sum =<<a+b;
getch();
}

SECTION-C
Q.4: Attempt all the questions (4x5 = 20)

i. What is constructor overloading? Explain with example


OR
Create a class time with hour, minute and second as its members. Create a constructor to
initialize the members. Write a function to display time.
ii. Write a program read three sides of triangle and print its area using formula area =√ s(s-
a+b+c
a)(s-b)(s-c) and s =
2
OR
Write a program that reads a number and tell whether it is prime or not.
iii. Write a program that creates a function name factorial which accepts a number as
argument and return its factorial.
OR
What are 2 dimensional arrays? How data is stored in it.
iv. What is inheritance? Elaborate with example.
OR
Write a program that read ten numbers in an array and find the smallest number in it
with its index.

*************

You might also like