Computer Science 1 Past Papers 


Subject: Computer Science-I

Time Allowed: 10 Minutes

Maximum Marks: 10

NOTE: Attempt this Paper on this Question Sheet only. Please encircle the correct option. Division of marks is given in front of each question. This Paper will be collected back after expiry of time limit mentioned above.


Part-I Encircle the right answer, cutting and overwriting is not allowed. (1×10=10)

Which one of the following is not used for sending an online message?

(a) facebook                                                      (b) skype

(c) gmail                                                               (d) google

Decimal number 74 has its equivalent binary that is equal to:

(a) 111111                                                           (b) 1010101

(c) 1000101                                                         (d) none

For A = pi r*r; which of the following is true in C++:

(a} Your variable: A                                          (b) Your variables: A, r

(c) Your variables: A, r, pi                              (d) your variables: true

Which of the following is true for a variable name to calculate sum of two numbers

(a) sum                                                                                 (b) sum(a, b)

(c) sum =a + b                                                    (d) both b and c

If = 4; and b= 5; then which of the following is true for at-r; and ++b ;

(a) a is 4, b is 5                                                   (b) a is 5, b is 5

(c) a is 4, b is 6                                                    (d) a is 5, b is 6

6. The file extension of a presentation program is:

(a) .ppt                                                                                 (b) .txt

(c) .pdf                                                                                 (d) .doc

In case of while loop, it is:

(a) Fixed iterations loop                                                (b) condition control loop

(c) Easy loop                                                       (d) incremental

8. If K=9, then k++ will give:

a) 9 (b) 10

(c) 11                                                                     (d) 12

9. You can run C++ in:

(a) mobile                                                           (b) computer

(c) laptop                                                             (d) both b and c

10. for int a = 2.9; cout<<a; will give you:

(a) 2                                                                       (b) 2.9

(c) 3.0                                                                    (d) All



Subject: Computer Science-I

Time Allowed: 2 Hours 45 Minutes

Maximum Marks: 50



Part-II Give short answers of the following. (20)

Q#1: What is the difference between input device and tactile input devices? Write an algorithm to calculate y such that  ( e.g., y = 4x2 )

Q#2: Give decimal equivalent of binary number: 11000111.

Q#3: Differentiate between int and float in C++ computer and write examples for each.

Q#4: Write program: to print out product of first five integers.

Q#5: Comment on the following in C++: selection and repetition (loop).


Part-III Give brief answers of the following. (30)

Q#3: (a) How the steps input, process and output are graphically shown in a flow chart? Differentiate between an algorithm and a flow chart? Write an algorithm to calculate and print ¢ such that c = (a + b)(a-b).

(b) Write C™ program to print a number, its square and cube such that the numbers are from | to 500. How you can print only odd numbers in the above series? .

Q#4: (a) Write program to read from the user a value of t and prints out y1, y2 and y3 in C#+ such that: y1 = sin (2t), y2=cos (4t) and y3=yI+y2

(b) Write C™ program to print the table of number 5.

Q#5: Write program to read from the user a value of a resistance R and current | and prints out values of voltage V and power P such that V = IR and P=VI. Comment on the following: float, main() and pow().

Prof.Fazal Rehman Shamil (Available for Professional Discussions)
1. Message on Facebook page for discussions,
2. Video lectures on Youtube
3. Email is only for Advertisement/business enquiries.