You are on page 1of 8

12S.PCPS.SUN.

1A

Fundamentals of Computer Science

J. Vasconcelos/L. Gil

12S.FCPS.SUN.1A

Fundamentals of Computer Science

J. Vasconcelos/L. Gu

Name

Date

6. Indicate what device(s) is (are) not related to computers:


M

Concepts Review & Exercises #2


Instructions: Answer the following questions to the best of your abilities.

rf^> to fjM
,.

/.L I

(a)

(b)

Cc)

(e)

(d)

1. Name the components of a typical personal computer system:


a)
r.) e)

J388
7. What type of data is stored inside an iPod or an MP3 player?

8. If 1110 relates to 14, 1011 relates to

2. Indicate the purpose of the following parts:

9. If 01000001 relates to A, 01000010 relates to


CPU: External memory: USB port:

10. Which value is the base of a ternary system?

11. Indicate what kind of signals are these?


3. True (T) or false (F): ( ) The Internet is a world-wide collection of networks. ( ) A bit has eight bytes.
(b) ( ) A computer with good input devices has no need for output ones.

( ) Processor speed is measured in gigawatts.

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.

5. A computer's main circuit board is called:

14. In your own words, indicate: (a) What is computer science?

12S.FCPS.SUN.1A

Fundamentals of Computer Science

3. Vasconcelos/L. Gu

12S.FCPS.SUN.1A

Fundamentals of Computer Science

J. Vasconcelos/L. Gu

19. In the formula y = 3x* + 2x + 3, x is the independent variable.


(b) What does a computer know?

a) In algebra, what does it mean that nx Is a variable"?

(c) What is the meaning of A = A + 1?

b) In computer programming, what does it mean that "x is a variable"?

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.

20. Name each category of operators


+ -x/ <>==* >
and
or

to answer the questions


not

(a) A guaranteed
method

(b)
An algorithm

(c) Cognitive restructuring

(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

Floating point 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=a+b*c/d+e y = a + (b * c) / d + e y = a + b * (c / d) + e y = (a + b)*c/d + e y = a + b*c/(d + e) y = (a + b) * c/(d + e)

# y is
# vis

# yis
# vis

# # # #

y y y y

is is is is

# y is # y is #y is
# vis

else if player2 has rock, game tied.

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

Fundamentals of Computer Science

J. Vasconcelos/L. Gu

12S.FCPS.SUN.1A

Fundamentals of Computer Science

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

34. What is the meaning of the following symbols?

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^

_TaT1 / * a) 0n'y sw|tcn SI is turned on:


b) Only switch S2 is turned on:

3
L2

c) Only switch S3 is turned on:

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)

Compute result as 1 / number


Write down result

(2.3)

Proceed to the next number

(3) End While

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

Fundamentals of Computer Science

J. Vasconcelos/L. Gu

12S.FCPS.SUN.1A

Fundamentals of Computer Science

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.

Let x be equal to 0, and / equal tc 0.


Repeat Increase the value on x by / Increase the value on / by 1 Until / is equal *.o 1n Display the value v

38. Describe what the following procedure does:

42. What could be an appropriate description (definition) for

a matryoshka, the typical nested Russian dolls?

iifeSp*1!^iSJ)
mm

(1?!$}^

Given A, a list of numbers.


Set X to the first item n A For each item in A If the item > X
Set X to the item

Output X

43. Five lotto balls were transported within a cylindrical

canister (with caps at both ends). When the balls are retrieved, the appearing numbers are 14, 8, 21, 3,

Q@@
,
,

39. Indicate the purpose of the formula: y = Viv*

and 12. Determine the order in which the balls were inserted if

(a) a "first come, first served" approach was followed:


(b) a "last come, first served" approach was followed:

,.
,_

44. In your own words, what is Turing legac to Computer science?

40. Given the following table:

a) Find the formula that relates the


X
-6
-4
.7

)' -18.5 -12.5

variable X with variable Y.

45. What did you learn in this class?

-6.5
-0.5

b) Describe the steps needed to get the


list of V-values.

2
4 6

5.5 11.5 17.5

09C.CMPS.BTH.1A
Na me

Foundations of Programming

J.Vasconcelos / V. Suwardiman Date

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?

Concepts Review & Exercises #1


1. Name the components of a typical personal computer system:
a)
c). .. b) d)

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.

e) 2. Indicate the purpose of the following parts:


CPU: ..

External memory. US3 port:

8. What would this sequence of instructions accomplish? (Hint: Read very carefully)
3. True (T) or salse (F):
Step 1: Divide 100 by 24.

-*>

( ) The Internet is a world-wide collection of networks.


( ) A bit has eight bytes.

Step 2: Round that answer up to the next larger whole number.


a) Calculates how many gallons of gas are used to go 100 miles. b) Calcu.ates how many vehicles are
needed to Calculates how

( ) A computer with good input devices has nc need for output ones.
( ) Processor speed is measured in gigawatts.

transport 100 people if every


vehicle carries 24

many boxes will be completely filled with apples if 100 apples are to be put in 24-apple
boxes.

d) All options are good.

( ) A program is a structured plan of action to reach a goal.


allows someone with internet access to exchange

people.

4. The

messages with any other internet user around the world


5. A computer's main circuit board is called:
Why?

~\

09C.CMPS.BTH.1A

Foundations of Programming

J.Vasconcclos / V. Suwardiman

09C.CMPS.BTH.1A

Foundations oi Programming

j.Vasconcelos / V. Suwardiman

"-r G3" _._ A __

"'

9. Given this snapshot of an


D T L Y C
M

13. Given the following decision tree, indicate what condition has to be true, in
order to reach the "b" at the bottom.

spreadsheet, what word can be


read in the second column?

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? .

14. Given the following conditionals, drawthe corresponding decision tree.


11. A new computer system is being installed in
a bulldozer for better controlling its efficiency. What Caterpillar belt the programmer must

order to be stopped, so the rocks are pushed


f"*

If playerl has rock then

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

12. A portion of an electro


mechanical system is
shown to the left.

15. Given the expression x > 6, what values are allowed?


(a) If the weight a is 10 Kg
and the weight b is 2 Kg, in
what direction rotates the shaft c?

fa; 0,1, 2,...

(b) 5, 6, 7,...

ft) 6, 7, 8, ...

(d) 7, 8

10

(b) If the shaft c rotates in


direction 2, wiat weight goes up?

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*

17. If the number a isdivided by b, how do you get the remainder?

21.

Describe a step-by-step procedure to draw the figure to the right. (Hint: Look very, very carefully.)

"*)

18. What results from following these steps?

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.

Step 5: Write down your answer:


(Note: There is only one result.)

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

correct, could you figure out the problem(s)?


(1) Start with the number 0 (2) While the number remains < 5 do (2.1) (2.2) (2.3) Compute result as 1 / number Write down result Proceed to the next number

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.)

(3) End While

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

Increase the value on x by / Increase the value on / by 1 Until /is equal to 10

Display the value of x

**>

09C.CMPS.BTH.1A

Foundations of Programming

J.Vasconcelos / V.Suwardiman

?*

23. What type of data is stored inside an IPod or an MP3


player?

24. Any previous experience with computers?

D Word Q WWW
Other?

Q Excel D HTML

Powerpoint D Flash

<$*>

25. What do you expect to learn in this class?

You might also like