Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Computer Science 12

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

COMPUTER SCIENCE

HSSC–II SECTION – A (Marks 13)


Time allowed: 20 Minutes
Q.1 Choose the correct option from the following. Each part carries one mark.
1)A executing instance of a program is called :
a)thread b)process c)state d)all of these
2) Which of the following phase of SDLC involves training of personnel to use the new system?
A. System Analysis B. System Implementation C. System Design D. System Coding
3) Which one of the following symbols is used in flow chart for the statement “Marks<33”?
A) B) C) D) D)

4) Which one of the following functions is used to read string “Computer Science”?
A) scanf( ) b)getchar( ) c)gets( ) d)getch( )
5) Which escape sequence can be used to insert a Tab in “C” Language?
A. \a B. \b C. \t D. \n
6) Which one of the following is the most suitable for making two ways decision?
A. if statement B. if-else statement C. switch statement D. Nested-if statement
7) How many times “Haripur” will be displayed by the following code? for (int i=1; i<10;i+=2)
printf (“Haripur”);
a) 1 B. 5 C. Infinite D. The loop will not run.
8) A pointer is an:
A. Operator B. Data type C. Keyword D. Variable
9) Which one of the following is the default access specifier of C++ class?
A. Private B. Public C. Protected D. Default
10) Identify the header file needed to read, write, and manipulate the file:
A. ifstream B. ofstream C. istream D. fstream
11) How many values a function can return at a time?
A. One value B. Two values C. Three values D. Any number of values
12)Default mode parameters for ofstream is:
A.ios::out B.ios::in C.ios::binary D.none of these
13.The name of the destructor always preceded by the symbol
A.+ B.% C. # D. ~
14) Ofstream is an:
A. Command B. Class C. Object D. Method
15) The dereference operator is denoted by:
A. * B. & C. % D. @
HSSC-II Examination Computer Science
SECTION-B
Time allowed: 2.40 hours Total Marks: 62
Q.2 Attempt all parts from the following. All parts carry equal marks. (143=42)

i. Why is memory management required? Give any three reasons.


ii. Write down any three differences between text and binary files.
OR
How is Constructor different from Destructor? List down any three differences.
Iii Write down any three responsibilities of System analyst.
OR
Mentioned the task performed by operating system.
iv) What will be displayed after executing the following statements?
int x = 3,
y = 17;
cout << x / y << y / x << (y / x) + (x % y);
OR
Write down the output of the following statements:
a. A = (x > 0) && (y < 10) , where x = 5, y = 15
b. S = 13 + 21 % 4
c. m *= 2; where m = 12
v) Define endl and setw manipulators and give example of each.
OR
Explain Constructor and destructor member function with example.
vi) What is Decision Control structure ?Write down all the type of decision control structure with syntax.
Vii) Why is it important to write Comments in a program? Also differentiate its two types with example.
OR
What is pointer in C++ Explain with its types.
viii) Write an if-else statement that assigns 1 to x if y is equal to 100, otherwise it should assign 0 to x.
OR
Show the memory representation of one and two dimensional array with example.
ix) What is the difference between array size and index? Illustrate with example.
x) What is function signature? Explain its different parts.
OR
Compare local and static variables in C++ functions.
xi) Write down differences between actual and formal parameters with example.
OR
Rewrite the program segment after removing errors:
int a{10}, i;
cout >> ” enter ten numbers ;
for (i = 0, i < 10, i--)
cin << a{i};
xii) What is reference operator? Give example.
OR
Write down the purpose of strcat() function with example.
xiii) What is file handling in C++? Explain two types of file handling in C++ with example.
xiv) How objects are created to access the member of a class?
SECTION – C (Marks 18)
Note: Attempt any THREE questions. All questions carry equal marks. (6x3=18)

Q.3 Describe the five state of Process with Diagram


OR
What is the importance of SDLC? Explain in detail the Feasibility and Testing phases
Q.4 Explain the concept of Polymorphism and Inheritance with one example of each from daily life.
OR
Describe the different types of operations performed on files
Q.5 Explain function Components with examples
Q.6 Write down difference between for loop and while loop with example and syntax
OR
Explain the scope of different types of variables used in C++
GOOD LUCK😊😊

You might also like