Federal Board 2017
Computer Science (Inter part2)
(SECTION-A)
Note: Pour possible answers A, B; C and D to each question are given. The choice which you think is correct that circle in front that question with Marker or Pen ink. 'Lining or filling two or more circles 'will result in zero mat k in that question. Write the letter A, B. (7 or D in the column.(write correct "option) against each question also. If there k a contradiction in the bubble and hand written answer, bubble option will be considered correct.
- A well-defined set of instructions given to the computer is called:
A. Hardware
B. Software
C. Data
D. Information
- The process of converting source code into object code is known as:
A. Compilation
B. Debugging
C. Linking
D. Information
A. b += a
B. a = +b
C. a = p + b
D. b = b +a
- How many bytes of memory is used by ‘char’ data type in C?
A. 1
B. 2
C. 3
D. 4
- Which of the following format specifier is used for integer data type?
A. %f
B. %i
C. %c
D. %d
- Which of the following is used as 'not equal to' operator in C language relational expressions'?
A. |=
B. <>
C. !=
D. ><
- In C-language the information about input and output functions is stored in------------ header file
A. math.h
B. stdio.h
C. string.h
D. conio.h
- If a = 15 and b = 10, what will be the output of the following expression?
a > b? a - b: a + b;
A. 15
B. 25
C. 5
D. 150
- What is a loop within another loop called?
A. Inner loop
B. counter loop
C. Sub Loop
D. Nested Loop
- Function declaration (prototype) does NOT contain:
A. Function name
B. Function return type
C. Parameters
D. Function body
- In C which mode opens the existing file for both reading and writing?
A. "W"
B. "rw"
C. "r+"
D. "a+"
- "In file processing system, the same data may be duplicated in several files". What is this drawback called?
A. data redundancy
B. data inconsistency
C. data dependency
D. data integrity
- A person, place, thing or event about which data is kept in the database is called:
A. an attribute
B. a field
C an entity
D. a record
- "A record from a table cannot be deleted if its associated record exists in related table". What is this database rule called?
A. Relationship
B. Referential integrity
C. Normalization
D. Schema
- ------------ is used to retrieve data from a database and present it to the user in formatted way
A. Report
B. Table
C. Query
D. Form
SUBJECTIVE PART
(Section-B)
Q.2 Answer any THIRTEEN parts. All parts carry equal marks.
- What are high level languages? How these languages are different from assembly language?
- What is Integrated Development Environment (lDE)? Differentiate between source program and object program.
- How variables are declared in C? Give two examples.
- Give purpose of the following escape sequences with one example each.
a. \n
b. \t
c. \r
- What are relational operators? Give examples.
- State three differences between syntax errors and logical errors.
- Give syntax of the for () loop and describe how it works?
- Give output of the following program code:
void main(void)
{
int a,b;
for(a=2 ; a<=4 ; a++)
for(b=a ; b<=3 ; b++)
printf("\n %d",a*b): }
- Write a program code in C that reads a number (n) and prints its multiplicative table up to 20.
- Write a program code in C that reads temperature (t) and prints a message as given below:
Temperature Message
t > 35 it is hot.
t >=20 and t<=35 It is nice day.
t<20 It is cold.
- Why loops are important it programming languages? Give three reasons.
- What is function header? Give its general form and one example.
- Write a C program statement to open a file "test.txt" in writing mode.
- What is one-to-many relationship between two entities? Give one example.
- What is DBMS? Give any two advantages of it.
- Why primary key is important in database file?
- Give any three advantages of using Forms in Access.
(Section-C)
Note: Attempt any THREE questions. All questions carry equal marks.
Q. 3
a. What is an expression? Explain any three types of expressions and their operators with examples.
b. Write a program code in C to find the sum of odd numbers from 1 to 100.
Q. 4
What is decision control structure? Explain different types of decision control statements used in C language (with purpose of use and syntax).
Q. 5
a. Explain the process of compiling, linking and executing a C program
b. Write a program code in C to read three numbers using scanf () function and find the largest number
Q. 6
a Give any four drawbacks of traditional file approach system.
b. What is entity relationship diagram (ERD)? Define the terms Entity, Attribute and Relationship with one example each.