You are on page 1of 4

Due Date: 8-32015

King Abdullah II School of Information Technology

Computer Skills for Humanities


Problem Solving Homework

0140495
Section No:
4
Student ID:

Student Name:

Sun, Tues, Thurs (9 10 am)

________________________________________________________________________________________
Choose the correct answer for each of the following questions:
1. Which of the following is not a data type?
a. Text

b. Integer

c. Boolean

d. String

2. Which of the following statements is incorrect:


a. C = 3

b. 3 = C

c. C = C + 4

d. C = X

3. What is the value of X after solving the following equation?


x = 3 * 4 + (2 ^ 1 ^ 4 / 4 - 1 * 2) Mod 2 2
a. 10

b. 2

c. 3

d. 7

4. What is the value of X after solving the following equation?


X = 29 Mod 12 + 15 / 2 + ((3 ^ 3 / 3) * 2 + 4) - 6 * 3 / 2
a. 4

b. 3

c. 7

d. 25.5

5. What is the value of Y after solving the following equation?


Y = 2 ^ 4 <= 4 ^ 2 And 7 <= 7 Or Not (1 > 5 - 2 * 2 And Not (6 <> 6))
a. 0

b. 1

c. True

d. False

6. What is the value of Y after solving the following equation?


Y = Not 18 Mod 7 = 33 / 3 And 900 / 9 >= 10 ^ 2 And Not True
a. False

b. True

c. 5

d. -1

7. What is the output for the following pseudo code?


1.
2.
3.
4.
5.
6.
7.
8.
a.

Start
Let c = 8
If c > 2 then go to step 5
Go to step 8
print c
Decrement c by 2
Go to step 3
Stop
8 6
b. 8 6 4

c. 8 6 4 2
1

d. 8

8. Which of the following Flowchart symbols is used for processing?


a.

c.

b.

d.

9. What is the output for the following flowchart?

a. 11 9 11

10.

b. 7 9 12

c. 11 9 12

d. 7 9 11

What is the equivalent Pseudo Code for the flowchart in question 9?

a. 1. Start
2. Let x = 7, y =
12
3. If x < y then
Print y-1 else Print
x
4. If y <> 11 then
Increment x by 2
5. Print x, y
6. Stop

b. 1. Start
2. Input x, y
3. If x < y then
Print y-1 else
Print x
4. If y <> 11
then Increment x
by 2
5. Print x, y
6. Stop

c. 1. Start
2. Let x = 7, y =
12
3. If x < y then
Print y-1
4. Print x
5. If y <> 11
then Increment x
by 2
6. Print x, y
7. Stop
2

d. 1. Start
2. Let x = 7, y =
12
3. If x < y then
Print y-1 else Print
x
4. If y <> 11 then
Increment x by 2
else Print x, y
5. Stop

11.

What is the output for the following flowchart?

a. 3

12.

b. 6

c. 8

d. 123

What is the equivalent Pseudo Code for the flowchart in question 11?

a.
2.
3.
4.
5.

1. Start
Let x = 3
Let f = 1
Let i = 1
If i <=x then
Print f
Stop
6. f = f * i
7. Increment i by
1

b.
2.
3.
4.
5.

1. Start
Let x = 3
Let f = 1
Let i = 1
If i <=x then
f=f*i
Increment i
by 1
6. Print f
7. Stop

c.
2.
3.
4.
5.

1. Start
Let x = 3
Let f = 1
Let i = 1
If i <=x then
f=f*i
Increment i
by 1
Go to 5
6. Print f
7. Stop

d.
2.
3.
4.
5.

1. Start
Let x = 3
Let f = 1
Let i = 1
If i <=x then
f=f*i
Increment i by

1
Go to 4
6. Print f
7. Stop

13. Which of the following pseudo code will read a number and then print
whether its a positive or a negative number?
a. 1. Input x
2. if x >= 0 then
Print x is
positive
3. Print x is
negative

b. 1. Input x
2. if x <= 0
then Print x is
negative
3. Print x is
positive

c.1. Input x
2. if x >= 0
then Print x is
positive else
Print x is
negative
3

d. None of them

14. What are the suitable words to be filled in the blanks so that the
following pseudo code will print the result of 2^4?
1.
2.
3.
4.
5.
6.
7.
a.

15.

Start
______ , count =0
Mul = Mul*2
count= count+1
If count<4 then _____
Print Mul
Stop
2. Mul = 1
b. 2. Mul = 0
5. goto 3
5. goto 3

c. 2. Mul = 1
5. goto 2

d. 2. Mul = 1
5. Mul = Mul * 2

What is the output for the following flowchart?

Assume that the inputs are: 7, 10, 11, 25

a. ***

b. ***
###
###
***

c. ***
###
***

d. ***
###
***
***

You might also like