Professional Documents
Culture Documents
1A
J. Vasconcelos/L. Gil
12S.FCPS.SUN.1A
J. Vasconcelos/L. Gu
Name
Date
rf^> to fjM
,.
/.L I
(a)
(b)
Cc)
(e)
(d)
J388
7. What type of data is stored inside an iPod or an MP3 player?
12. How do you determine the way to sort 1 million of 32-bit integers within two megabytes of RAM?
( ) A program is a structured plan of action to reach a goal. 13. How much memory would be required by a picture taken with a 6.1 mega pixels
camera if there is no compression?
4. The
allows someone with internet access to exchange messages with any other internet user around the world.
12S.FCPS.SUN.1A
3. Vasconcelos/L. Gu
12S.FCPS.SUN.1A
J. Vasconcelos/L. Gu
15. When Jean cannot figure out the answer to a question on a multiple-choice test,
she just chooses answer "b" because she has been told that this is a good
method to use. Jean is relying upon
that she cannot figure out.
(a) A guaranteed
method
(b)
An algorithm
(d)
A heuristic
(e)
Inductive
reasoning
21. Given the following decision tree, indicate what condition(s) has (have) to be
true, in order to reach the "b" at the bottom.
16. Bob is having trouble coming up with the answer to a math problem. He decides io look through the book and finds the step-by-step procedure for solving the problem. If he follows the steps in the book, he is using:
(b) Subgoa's
Working
backwards
(0
(d)
A heuristic
(e) Chunking
An algorithm
17. Let a=5, 6=10, c=2, d-5 and e=l, indicate the value of y after evaluating the following expressions (no calculator allowed):
Integer division
22. Given the following conditionals, draw the corresponding decision tree.
If playerl has rock then if player2 has paper, then player2 wins else if player2 has scissors, then playerl wins
a) b) c) d) e) f)
# y is
# vis
# yis
# vis
# # # #
y y y y
is is is is
# y is # y is #y is
# vis
18. Let S = 1024, what happens to S, if the digits of its binary representation are shifted two places to the right? (Hint: Read and think very carefully.)
23. Given the expression y = 5x - 2, for x = 2, ..., 11, how many values of y will be produced? (a) 8,13, 18,... (b) 10 (c) 11 (d) 9
12S.FCPS.SUN.1A
J. Vasconcelos/L. Gu
12S.FCPS.SUN.1A
J. Vasconcelos/L. Gu
24. Suppose you are interested in the next Mariners vs. Rangers game for which you can attend to the stadium or watch on TV. Write down all the possible
cases involved in trying to watch the game.
Vatch the game
32. A.
is the implementation of an algorithm in a particular computer language, like Ruby or Python. is the graphical representation of an algorithm.
33. A
Go to the stadium Follow on TV
25. A
expression compares two values, which results ir any of two possible rutcomes: or .
o<=>
35. If the number a is divided by b, how do you get the remainder? (Note: Describe the procedure without using the modulus operator. Also, neither a or b are floating point values.)
26. Write an algebraic expression equivalent Lo the claim: w,f I get a car with gas or
a bicycle, then I go to the park."
27. Given this logic circuit, what ligl : is turned on in the following cases?
&2
&>
tt^
3
L2
36. You were asked to compute the decimal values of Vi/ Vi, 1/j, Vi, Vs, following
the instructions below. However, someho/v the results you get are not correct; could you figure out the problem(s)?
(1) Start with the number 0
28. How many random numbers you can get following an algorithm?
29. Provide a recursive definition for the series 1, 1, ?., 3, 5, 8, ... (2) While the number remains < 5 do
(2.1)
(2.2)
(2.3)
30. Given the expression 0 < X < 10, how many values can X Lake?
a) If X is a whole number:
31. The value nf t\ js
b) If X is a real number:.
12S.FCPS.SUN.1A
J. Vasconcelos/L. Gu
12S.FCPS.SUN.1A
J. Vasconcelos/L. Gu
37. What result should you expect to happen if the following instructions are
followed correctly? .
41. Given the formula y = 0.5x2 - 3, describe the necessary steps to get the list of
V-values, for an X-value range from -3 to +3.
iifeSp*1!^iSJ)
mm
(1?!$}^
Output X
canister (with caps at both ends). When the balls are retrieved, the appearing numbers are 14, 8, 21, 3,
Q@@
,
,
and 12. Determine the order in which the balls were inserted if
,.
,_
-6.5
-0.5
2
4 6
09C.CMPS.BTH.1A
Na me
Foundations of Programming
09CXMPS.BTH.1A
Foundations of Programming
J.Vasconcelos / V. Suwardiman
6. How do you determine the way to sort 1 million of 32-bit integers within two
megabytes of RAM?
7. Let a=5, 6=10, c=2, o*=5 and e=l, indicate the value of y after evaluating the
following expressions (no calculator allowed): a)y b) y c) y d) y e) y 0 y = = = = = = a + b*c/d + e a + (b * c) / d + e a + b * (c / d) + e (a + b) * c / d + e a + b * c / (d + e) (a + b) * c / (d + e) //yis. // y is. // y is. // y is. // y is. // y is.
8. What would this sequence of instructions accomplish? (Hint: Read very carefully)
3. True (T) or salse (F):
Step 1: Divide 100 by 24.
-*>
( ) A computer with good input devices has nc need for output ones.
( ) Processor speed is measured in gigawatts.
many boxes will be completely filled with apples if 100 apples are to be put in 24-apple
boxes.
people.
4. The
~\
09C.CMPS.BTH.1A
Foundations of Programming
J.Vasconcclos / V. Suwardiman
09C.CMPS.BTH.1A
Foundations oi Programming
j.Vasconcelos / V. Suwardiman
"'
13. Given the following decision tree, indicate what condition has to be true, in
order to reach the "b" at the bottom.
f'" A
2 ! H
S C
1
L K
3! 1
P '
s
T
10 Ateceptioniit works daily 3Vi hours during the morning before taking a %hour lunch. During theafternoon, she works 4Vi before retiring for the day at 5:30
PM. What time did she start working? .
to the right?
(a) Left
(b) Right
if player2 has paper, then player2 wins else if player2 has scissors, then playerl wins else if player2 has rock, game tied.
-i
(b) 5, 6, 7,...
ft) 6, 7, 8, ...
(d) 7, 8
10
16. Imaginethat only two factors affect yourdecisions: money and time. Also, you are Interested In watching a movie in the theatre. Write down all the possible cases involved in tryingto attend the movie theatre.
Money ITime
Movie
~">
09C.CMPS.BTH.1A
Foundations of Programming
J.Vasconcelos / V. Suwardiman
09C.CMPS.BTH.1A
Foundations of Programming
J.Vasconcelos / V. Suwardiman
f*
21.
Describe a step-by-step procedure to draw the figure to the right. (Hint: Look very, very carefully.)
"*)
Step 1: Think of a number, but ke3p it silently in your mind. Step 2: Take your number and multiply it by 2
Step 3: Add 8 to the previous result.
Step 4: Take the result in step 3 and subtract the number you started
with.
19. /ou were asked to compute the decimal values of l/i, %, /z, Vi, Vs/ following
the instructions below. However, somehow the results you get are not
22. A terrible virus has devastated your computer and now you have use an old mechanical typewriter to finish your science
report. The cover page is pretty laborious: any text there must appear neatly centered. To avoid guessing, you should dev.se a formula that, regardless of the text length, tells you the right amount of spaces to be left before typing the text. (Hint: this typewriter has a page width of only 60 characters.)
20. What result should you expect to happen if the following instructions are
fo'lowed correctly? Let x be equal to 0, and i equal to 0.
Repeat
**>
09C.CMPS.BTH.1A
Foundations of Programming
J.Vasconcelos / V.Suwardiman
?*
D Word Q WWW
Other?
Q Excel D HTML
Powerpoint D Flash
<$*>