Computer Science Part 2 Half Book Test Normal Student

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

Hizb - Ur - Rehman Islamic Science High School & College

Darbar Hazrat Syed Muhammad Abdullah Shah Mashhadi Qadri, Moza Qadir Bakhsh Sharif, Tehsil Kamalia,

District T.T. Singh.


Student Name Roll Num Class Name
INTER-||
Exam Name Paper Code Subject Name
COMPUTER SCIENCE
Time Allowed Total Marks Exam Date
1hour30min 2024-02-29

‫تس‬
Q1. Choose the correct answer. 15X1=15 ‫رپدارئہاگلںیئ۔‬ ‫اچرہنکمموجاابتںیمےسدر‬
1.A collection of raw facts and figures is called: .1
(A) Data (B) Information (C) Processing (D) None
2.The smallest meaningful unit of data in a database is called: .2
(A) Byte (B) Record (C) Character (D) Field
3.A collection of related fields is: .3
(A) File (B) Record (C) Database (D) None
4.A logical grouping of characters is a: .4
(A) Filed (B) Record (C) File (D) All
5.......... is used to define characteristics of an entity/object. .5
(A) Object (B) Attributes (C) Records (D) Files
6.Which one of the following is used to associate entities with each other? .6
(A) Attributes (B) Relationship (C) Entities (D) Cardinals/Identifier
7.A relationship between countries and capitals is an example of relationship: .7
(A) One-to-one (B) One-to-Many (C) Many-to-Many (D) Many-to-One
8.The name of header file is written between: .8
(A) [ ] (B) ( ) (C) <> (D) << >>
9.Another term for a computer making a decision is: .9
(A) Sequential (B) Selection (C) Repetition (D) Iteration
10.Which of the following is used for making two way decisions? .10
(A) If (B) If – else (C) Nested if (D) Switch
11.Which keyword is not used in switch statement? .11
(A) Default (B) If (C) Case (D) Switch
12.Which of the following is called counter loop? .12
(A) Nested if – else (B) If – else (C) For loop (D) While loop
13.In which loop the condition comes after the body of the loop? .13
(A) For () (B) While () (C) Do-while () (D) Nested for ()
14.What is the final value of x after executing the following code for (int x=0; x<,10; x++)? .14
(A) 8 (B) 9 (C) 10 (D) 11
15.What is the final value of I after executing the following code for (int i=1; i<5; i+=2)? .15
(A) 7 (B) 5 (C) 6 (D) 9
Q 2 .Write short answers of the following questions. (Any 6) 6X2=12 ‫وکیئےس)دنمرہجذلیوساالتےکرصتخموجاابترحتریرکںی۔‬6(
I.List the file types from function point of view.: .I
II.What is meant by data modeling?: .II
III.Differentiate between syntax error and logical error.: .III
IV.Name two main categories of programming language.: .IV
V.List any four commonly used high level languages.: .V
VI.Show output. .VI
int p=10;
if (p!=10)
p=0
; else
p=5;:
VII.Trace the errors in the following codes. .VII
void main ()
int x, y=5;
if (x>y);
printf (“x is largest”);
else
printf (“y is largest”);
getch();:
VIII.Write output. .VIII
int x=5, y=3;
do
{
x=x*2;
y=y+2;
}
while (y<7);
printf(“%d”,x);:
IX.Differentiate between data and information.: .IX
Q 3 .Write short answers of the following questions. (Any 6) 6X2=12 ‫وکیئےس)دنمرہجذلیوساالتےکرصتخموجاابترحتریرکںی۔‬6(
I.What is file?: .I
II.Write the use of ER diagram.: .II
III.What is #define directives?: .III
IV.Why does machine language program executes faster that high level language?: .IV
V.Write use of “if-else-if” statement.: .V
VI.What happens if break is missed in case block?: .VI
VII.Write down the output of the following code: .VII
Char ch=’a’;
switch (ch)
{
case ‘a’:
Printf(“A”);
Case ‘b’:
Printf(“B”):
VIII.What is conditional operator? Write its syntax.: .VIII
IX.Write the syntax of do-while loop, both for single statement and for multiple statement.: .IX
Q 4 .Write short answers of the following questions. (Any 6) 6X2=12 ‫وکیئےس)دنمرہجذلیوساالتےکرصتخموجاابترحتریرکںی۔‬6(
I.Trace the error: .I
int a=2
if (a=1)
printf (“OK”);
else
printf (“Cancel”):
II.Make a flowchart of while loop.: .II
III.Convert following loop code into for loop code .III
. i=3;
do
{
printf (“%d\n”, i);
i+=3;
}
while (i<=21);:
IV.Convert the following do-while loop in for loop. .IV
int c=2;
do
printf (“%C”, c);
while (c++ <=5);:
V.What are the advantages of database approach over traditional file approach?: .V
VI.Define the term DDL.: .VI
VII.State the use of data volume and usage methods.: .VII
VIII.State three types of relationship between two attributes with one example of each.: .VIII
IX.Which part of the loop contains the statements to be repeated?: .IX
Q 5 .Write detailed answers of the following questions. (Any 3) 3X8=24 ‫وکیئےس)دنمرہجذلیوساالتےکًالیصفتوجاابترحتریرکںی۔‬3(
I.Explain database management system. Discuss any three advantages of database management system.: .I
II.Define language processor or translator and also explain its types.: .II
III.Describe the file types from usage point of view and functional point of view.: .III
IV.Discuss the objectives of the database in your own words.: .IV
V.Write a program that inputs two numbers and asks for the choice of the user, if user enters 1 then displays the sum of
numbers, if user enters 2 then displays result of subtraction of the numbers, if user enters 3 then displays the result of the
multiplication of the numbers and if user enters 4 then displays result of the division of the numbers, otherwise displays
the message “Wrong choice”. Use a switch statement to implement the solution.:
.V

You might also like