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

i

on
m
lra
fA
Sai
g.
En

Tests Bank
Problem Solving
51 | P a g e
Chapter 1 Tests Bank: Problem Solving

1. If the value of the variable A = 5.9 x 10 ^ - 4, then the data type of the A is:
A. Real Number B. Integer Number C. Boolean D. String
2. What is the data type of the variable Y in the following assignment statement:
Y = “Welcome”
A. Real Number B. Integer Number C. Boolean D. String
3. Which of the following assignment statements is correct:
A. X - 1 = Y + 5 B. Y + X = 6 C. 9 = Y D. Y = X + 10
4. Which of the following assignment statements is correct:
A. 5 = C B. 1 + X= m C. C + 3 D. j = p+2
5. Which of the following assignment statements is not correct:
A. X = Z - 5 B. X * 2 = Y C. Z = Z ^ 2 D. Y = Z
6. Which of the following assignment statements store 5 in the variable Y:
A. Y = 5 B. 5 = Y C. Y = Y + 5 D. None of Them
i
on

7. Which of the following is a data type:


m
lra
fA

A. Flowcharts B. Pseudocode C. String D. Selection


Sai

8. Which of the following is Not a data type:


g.
En

A. Integer B. Audio C. String D. Real


9. What is the value of X after solving the following equation:
X = 2 ^ 4 + (15 / 3 * 4) / 4 mod 5 + 1
A. 16 B. 20 C. 17 D. 22
10. What is the value of X after solving the following equation:
X = 3 ^ 2 ^ 1 – 2 + ( 3 ^ 3 * 3 ^ -3 + 2 ) * 5 mod 3
A. 9 B. 22 C. 7 D. 12
11. 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
12. 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.5 D. 25.5
13. What is the value of X after solving the following equation:
X = 25 Mod 12 + 15 / 2 + (( 3 ^ 3 / 3 ) * 2 + 4 ) - 6 * 3 / 2
A. 4 B. 21.5 C. 7 D. 3
14. The output of the following expression is:
X = 6 / 2 * 3 * 2 - 6 Mod 7 + 5 + (-2) ^ 2 ^ 2
A. 8 B. 20 C. 33 D. 10
52 | P a g e
15. The output of the following expression is:
Y = 6 * 2 – 9 + ( 2 * 1 + 3 ^ 2 ) + 2 / 1 ^ -4
A. 15 B. 5 C. 11 D. 16
16. What is the value of X after solving the following equation:
X = 10 mod 5 * 3 + ( 6 + 2 ^ 3 ) / 2
A. 7 B. 16 C. 6 D. 17
17. What is the value of X after solving the following equation:
X = 2 mod 4 ^ 2 + ( 3 – 6 / 2 ) * 4
A. -2 B. 0 C. 4 D. 2
18. What is the value of X after solving the following equation:
Y = 4 + ( 3 + 15 / 5 * 3 ) + 1 ^ 3 ^ 2 mod 9
A. 25 B. 15.8 C. 17 D. 9
19. What is the value of X after solving the following equation:
Y = 7 mod 6 * 2 + ( 9 / 3 * 2 + 1 ) + 1 ^ 4 ^ 2
A. 15 B. 10 C. 30 D. 10.5
20. What is the value of X after solving the following equation:
i
on
m

X = 8 mod 3 * 6 + ( 5 + 3 ^ 2 ) / 7
lra
fA

A. 13.5 B. 10 C. 14 D. 16
Sai

21. The output of the following expression is:


g.
En

X= 3 >= 9 or 5 + 1 <> 2 and not 7 – 3 < 2 or not true


A. True B. False C. 5 D. 0
22. The output of the following expression is:
Y = 6 * 3 <= 12 Or Not (10 > 10 Mod 2 And 2 ^ 3 = 9)
A. True B. False C. 5 D. 0
23. The output of the following expression is:
Y = Not 20 Mod 8 = 33 / 3 And 900 / 9 >= 10 ^ 2 And Not True
A. False B. True C. 5 D. -1
24. The output of the following expression is:
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
25. The output of the following expression is:
Y = Not 18 Mod 7 = 33 / 3 And 900 / 9 >= 10 ^ 2 And Not True
A. False B. True C. 5 D. -1
26. The output of the following expression is:
Y = (( 2 * 5 + 4 ^ 2 > 2 ^ 4 ) or False) and not ( 2 ^ 3 + 4 * 3) mod 30 < 3
A. False B. True C. 3 D. -2

53 | P a g e
27. The output of the following expression is:
Y = 7 mod 3 <> 8 mod 2 ^ 2 and 3 ^ 2 = 2 ^ 3 or Not 2 + 2 / 2 > 2
A. True B. False C. 1 D. 4
28. The output of the following expression is:
Y = 3 ^ 0 < > 1 and not 8 / 2 > 4 or 5 <= 3
A. 8 B. False C. 10 D. True
29. The output of the following expression is:
Y = 5 ^ 0 < > 1 or not 9 / 3 >= 6 and 8 < 4
A. 9 B. 5 C. True D. False
30. The output of the following expression is:
Y = 12 / 3 >= 3 and not 4 < 9 or 1 ^ 5 = 5
A. True B. False C. 13 D. 9
31. The output of the following expression is:
B = not 4 ^ 2 = 8 and 5 mod <= 2 or 3 = 1 ^ 3
A. 0 B. True C. False D. 2
32. What is the output for the following code, assume that the inputs are: 4 , 1 , 8
i
on

1. Start
m
lra

2. a = 4
fA

3. Input x
ai
S

4. If a mod x = 0 then go to 6
g.
En

5. Go to 8
6. Print x
7. Go to step 3
8. Stop
A. 4 1 8 B. 4 1 C. 4 D. None of Them
33. What is the output for the following code
1. C = 9
2. If c >= 1 then go to 4
3. Go to 7
4. Print C
5. C = C - 3
6. Go to 2
7. Stop
A. 9 6 3 0 B. 6 3 C. 9 6 3 D. None of Them
34. What is the output for the following pseudo code, given the following numbers (1 , 3 , 2)
1. C = 1
2. If C < 4 then Go to step 4
3. Go to step 8
4. Input x
5. Print x ^ 2
6. Increment C by 1
7. Go to step 2
8. Print “*”
9. End
A. 1 9 B. 1 3 2 * C. 1 2 3 * * * D. 1 9 4 *
54 | P a g e
35. What is the output for the following pseudo code, given the following numbers
( 1 , 3 , 2 , 7 , 6)
1. C = 1
2. Input x
3. Max = x
4. If C < 5 then Go to step 6
5. Go to step 10
6. Input x
7. If x > max then max = x
8. Increment C by 1
9. Go to step 4
10. Print max
11. End
A. 7 B. 14 C. 6 D. 5
36. What is the output for the following pseudo code, given the following numbers
(2 , 1 , 4 , 3)
1. Start
2. X = 3
3. Input Y
4. If x < y then print y * y
i
on

5. Decrement X by 1
m

6. If x >= 0 then go to step 3


lra
fA

7. stop
ai

A. 4 1 1 6 9 B. 4 1 1 6 C. 9 4 1 0 D. 4 1
S
g.

37. What is the output for the following pseudo code, given the following numbers
En

(2 , 7 , 1 , 6 , 6 , 6 , 1 , 5)
1. Start
2. S = 20
3. Input a , b
4. If a > b then print b else print a + 1
5. Decrement s by 4
6. If s >= 10 then go to step 3
7. stop
A. 3 7 B. 3 2 7 C. 3 7 1 2 D. 2 1 7
38. What is the output for the following pseudo code, given the following numbers
(2 , 6 , 1 , 7 , 6 , 3 , 1 , 5)
1. Start
2. S = 20
3. Input a , b
4. If a > b, then print b else print a + 1
5. Decrement s by 4
6. If s >= 10 then go to step 3
7. stop
A. 2 1 7 B. 3 7 1 C. 3 2 3 D. 3 6 6

55 | P a g e
39. What is the output for the following pseudo code, given the following numbers
(5 , 7 , 4 , 1)
1. Start
2. X = 8
3. Input y
4. If x > y, then print y * y
5. Decrement x by 1
6. If x >= 5 then go to step 3
7. stop
A. 25 49 16 1 B. 25 49 16 C. 25 16 1 D. 25
40. Which of the following pseudo code will read a number and then print whether it’s odd or even
number?

A. 1. Input x B. 1. Input x C. 1. Input x


2. if x mod 2= 0 2. if x mod 2= 0 2. if x mod 2 = 0
then Print “x is then Print “x is then Print “x is D. None of them
even” odd” even” else Print
3. Print “x is odd” 3. Print “x is even” “x is odd”
41. What are the suitable words to be filled in the blanks so that the following pseudo code
i

will print the odd numbers between 1 to 10.


on
m

1. Start
lra

2. Count =_____
fA
ai

3. Print Count.
S
g.

4. Count = Count +_____


En

5. If Count <= 10 then go to _____


6. Stop
A. 2. 1 B. 2. 2 C. 2. 1
4. 1 4. 2 4. 2 D. None of Them
5. Step 2 5. Step 3 5. Step 3

56 | P a g e
42. Write the equivalent Pseudo Code for the following flowchart:

i
on
m
lra
fA
Sai
g.
En

A. 1. Start B. 1. Start C. 1. Start


2. Let x = 8, y =12 2. Let x = 8, y = 12 2. Let x = 8, y =12
3. If x + y > 10 3. If x + y > 10 3. If x + y > 10
Then: Then: Then Decrement
a) Decrement y a) Decrement y y by 10
by 10 by 10 else Increment x
b) Print x , y b) print x, y by 2 D. None of them
4. Increment x by 2 else Increment 4. print x, y
5. If x – y <> 2 x by 2 5. If x – y <> 2 then
then print 4. If x – y <> 2 print “Test
“Test” then print 6. Stop
6. Stop “Test”
5. Stop

57 | P a g e
43. Write the equivalent Pseudo Code for the following flowchart:

i
on
m
lra
fA

A. 1. Input x, j C. 1. let x = 5 , j =1
B. 1. let x = 5 , j =1
ai

2. print x
S

2. Print x
2. print x
g.

3. Increment 3. Increment
En

3. Increment
j by 1 j by 1
j by 1
4. If j <= x then go 4. If j <= x then go D. None of them
4. If j <= x then go
to step 2 to step 2
to step 3 else
5. Decrement 5. Decrement
decrement x by 1
x by 1 x by 1
5. Print x
6. Print x 6. Print x

58 | P a g e
44. Write the equivalent Pseudo Code for the following flowchart:

i
on
m
lra
fA

A. 1. Start B. 1. Start C. 1. Start D. 1. Start


ai

2. Let x = 5, y = 8 2. Input x, y 2. Let x = 5, y = 8 2. Let x = 5, y = 8


S
g.

3. If x < y then 3. If x < y then 3. If x < y then 3. If x < y then


En

Print y - 6 else Print y - 6 else Print y - 6 Print y - 6 else


Print x Print x 4. Print x Print x
4. If y <> 2 then 4. If y <> 2 then 5. If y <> 2 then 4. If y <> 2 then
Increment x by 2 Increment x by 2 Increment x by 2 Increment x by
5. Print x, y 5. Print x, y 6. Print x, y 2 else Print x, y
6. Stop 6. Stop 7. Stop 5. Stop

59 | P a g e
45. Write the equivalent Pseudo Code for the following flowchart:

i
on
m
lra

A. 1. Start C. 1. Start D. 1. Start


B. 1. Start
fA

2. Let d = 1 2. Let d=1 2. Let d=1


2. Let d = 1
ai

3. Let s = 0 3. Let s=0 3. Let s=0


S

3. Let s = 0
g.

4. 5. If d < 5 then 4. If d <5 then 4. If d <5 then


En

4. if d < 5 then
Increment s Increment s Increment s
5. Increment s
by 10 by 10 by 10
by 10
Stop Increment d Increment d
6. d = d + 1
6. d = d + 1 by 1, Go to 4 by 1
Print s
7. Print s else Print f else Print f
7. Stop
8. Stop 5. Stop 5. Stop

60 | P a g e
46. Write the equivalent Pseudo Code for the following flowchart:

i
on
m

A. 1. Start B. 1. Start C. 1. Start D. 1. Start


lra
fA

2. Let x = 3 2. Let x = 3 2. Let x = 3 2. Let x = 3


ai

3. Let f = 1 3. Let f = 1 3. Let f = 1 3. Let f = 1


S
g.

4. Let i = 1 4. Let i = 1 4. Let i = 1 4. Let i = 1


En

5. If i <=x then 5. If i <=x then 5. If i <=x then 5. If i <=x then


Print f f=f*i f=f*i f=f*i
Stop Increment i by 1 Increment i by 1 Increment i by 1
6. f = f * i 6. Print f Go to 5 Go to 4
7. Increment i by 1 7. Stop 6. Print f 6. Print f
7. Stop 7. Stop

61 | P a g e
47. Write the equivalent Pseudo Code for the following flowchart:

i
on
m
lra

A. 1. Start B. 1. Start C. 1. Start


fA

2. input x 2. input x 2. input x


Sai

3. if x >= 5 then 3. if x >= 5 then 3. if x >= 5 then


g.
En

Print x ^ 2 Print x / 2 else Print x / 2 else


D. None of them
4. print x / 2 Print x ^ 2 Print x ^ 2
5. If x mod 2 <> 0 4. If x mod 2 <> 0 4. If x mod 2 <> 0
Then go to 2 Then go to 2 Then go to 3
6. stop 5. Stop 5. Stop

48. Find the wrong statement in the following pseudo code that is written to find and print the
summation of even numbers between 1 and 10:
1. Start
2. Let Sum = 0
3. Let X = 2
4. Sum = Sum + X
5. X = X + 1
6. If X <= 10 then go to step 4
7. Print Sum
8. Stop
D. Statement 6
A. Statement 2 it B. Statement 4 it C. Statement 5 it
should be If
should be let should be should be
X <= 10 then go to
sum = 10 X = X + Sum X=X+2
step 3

62 | P a g e
49. What are the suitable words to be filled in the blanks so that the following pseudo code
will input 4 numbers and print the summation of positive number only:
1. Start.
2. Count = 1, Sum = 0
3. Input X
4. If __________ then Sum = Sum + X
5. Count = Count + 1
6. If Count <= 4 then go to _________
7. Print Sum
8. Stop

A. 4. X > 0 B. X < 0 C. X > 0 D. X < 0


6. Step 3 6. Step 3 Step 4 Step 4

i
on
m
lra
fA
Sai
g.
En

63 | P a g e
‫‪The Nerd in Computer Skills for Humanities Schools‬‬
‫حلول اسئلة السنوات للوحدة االول‬

‫االجابة‬ ‫السؤال‬ ‫االجابة‬ ‫السؤال‬ ‫االجابة‬ ‫السؤال‬

‫‪A‬‬ ‫‪35‬‬ ‫‪C‬‬ ‫‪18‬‬ ‫‪A‬‬ ‫‪1‬‬

‫‪A‬‬
‫ولكن بالخطوة ‪ 4‬بدل اشارة‬ ‫‪36‬‬ ‫‪A‬‬ ‫‪19‬‬ ‫‪D‬‬ ‫‪2‬‬
‫< نضع اشارة > يف السؤال‬

‫‪B‬‬ ‫‪37‬‬ ‫‪B‬‬ ‫‪20‬‬ ‫‪D‬‬ ‫‪3‬‬


‫‪C‬‬ ‫‪38‬‬ ‫‪A‬‬ ‫‪21‬‬ ‫‪D‬‬ ‫‪4‬‬

‫‪C‬‬ ‫‪39‬‬ ‫‪B‬‬ ‫‪22‬‬ ‫‪B‬‬ ‫‪5‬‬

‫‪C‬‬ ‫‪40‬‬ ‫‪A‬‬ ‫‪i‬‬ ‫‪23‬‬ ‫‪A‬‬ ‫‪6‬‬


‫‪on‬‬
‫‪m‬‬

‫‪C‬‬ ‫‪41‬‬ ‫‪C‬‬ ‫‪24‬‬ ‫‪C‬‬ ‫‪7‬‬


‫‪ra‬‬
‫‪Al‬‬
‫‪f‬‬

‫‪B‬‬ ‫‪42‬‬ ‫‪A‬‬ ‫‪25‬‬ ‫‪B‬‬ ‫‪8‬‬


‫‪S‬‬‫‪ai‬‬
‫‪g.‬‬

‫‪B‬‬ ‫‪43‬‬ ‫‪B‬‬ ‫‪26‬‬ ‫‪C‬‬ ‫‪9‬‬


‫‪En‬‬

‫‪A‬‬ ‫‪44‬‬ ‫‪B‬‬ ‫‪27‬‬ ‫‪C‬‬ ‫‪10‬‬


‫‪C‬‬ ‫‪45‬‬ ‫‪B‬‬ ‫‪28‬‬ ‫‪A‬‬ ‫‪11‬‬
‫‪C‬‬ ‫‪46‬‬ ‫‪D‬‬ ‫‪29‬‬ ‫‪D‬‬ ‫‪12‬‬

‫‪B‬‬ ‫‪47‬‬ ‫‪B‬‬ ‫‪30‬‬ ‫‪B‬‬ ‫‪13‬‬

‫‪B‬‬
‫‪B‬‬ ‫‪48‬‬ ‫ولكن بعد ال‪ mod‬نضع‬ ‫‪31‬‬ ‫‪C‬‬ ‫‪14‬‬
‫الرقم ‪ 2‬بالسؤال‬

‫‪A‬‬ ‫‪49‬‬ ‫‪B‬‬ ‫‪32‬‬ ‫‪D‬‬ ‫‪15‬‬


‫‪C‬‬ ‫‪33‬‬ ‫‪D‬‬ ‫‪16‬‬

‫‪D‬‬ ‫‪34‬‬ ‫‪D‬‬ ‫‪17‬‬

‫هذه الجابات لالسئلة الموجودة ف الدوسية ف صفحة ‪ 52‬ى‬


‫وحت صفحة ‪.63‬‬ ‫•‬
‫ي‬ ‫ي‬

‫شيين عند البوابة الرئيسية‪ ،‬ومكتبة الرائد عند جرس الزراعة‪.‬‬


‫الدوسية متوفرة يف مكتبة ر‬ ‫•‬

‫الرمون‪.‬‬
‫ي‬ ‫للحصص الخصوصية‪ ،‬التواصل عىل ‪ +962 77 922 8439‬م‪ .‬سيف‬ ‫•‬

You might also like