Computer Programming Track Pre

advertisement
Name:____________________________________________
Computer Programming Track Pre-assessment
Directions: Answer the following questions independently. If you do not know an answer leave it blank or
try to guess.
1. You are given a crate of identical eggs. You have access to a 100-story building. The eggs can be very
hard or very fragile meaning that they may break if dropped from the first floor or may not even break if
dropped from the 100th floor. You need to figure out the highest floor an egg can be dropped from
without breaking. All eggs will break at the same height.
Describe the most efficient way you can think of to solve this problem. (Efficiency is measured in
number of egg drops.)
2. Stacey, Carla, Julia and Rose want to take seats in a cinema. There is only 1 aisle seat and the rest are in
a line next to it. If Rose wants to sit in the aisle seat, Carla doesn’t want to sit next to Julia, and Julia
wants to sit next to Stacey, what is one possible way they can sit? (starting at the aisle)?
3. I have different shapes. The triangle is smaller than the rectangle. The rectangle is larger than the circle. The
circle is smaller than the square. The octagon is larger than the triangle. The pentagon is smaller than the
octagon. The ellipse is larger than the pentagon. Which of these cannot be the largest shape? (Select one.)
Rectangle
Octagon
Circle
Square
4. Grace thought of a number, added 7, multiplied by 3, took away 5 and divided by 4 to give an answer of 7.
What was her starting number?
5.
What is B1 + C2?
Name:____________________________________________
6. Flight tickets for an airline are coded as follows:
Flights to Africa are coded A, Flights to Europe are coded B, Asian Destinations C, and the Americas D.
If a flight takes place between 10 pm and 6 am the same code are used but with lower case letters
(a,b,c, and d). Male passengers are coded X and female passengers are coded Y. Children are coded by
the same letters in lower case (x.y). Meals are coded as follows: European meal G, Asian Meal H,
Vegetarian Meal K. Children's meals coded by the same letters in lower case (g,h,k) First Class
passengers are coded P, Business Class Q and economy R
What would the code be for a flight to Paris at 5am for a vegetarian 8 year old girl travelling economy
class?
7. Three computers were lined up in a row. The Dell was to the left of the Viglen but not necessarily next to
it. The blue computer was to the right of the white computer. The black computer was to the left of the
Hewlett Packard PC. The Hewlett Packard was to the left of the Viglen. What color is the HP computer?
8. In a counting system used by intelligent apes.
A banana = 1
6 is represented by an orange and 2 bananas
An orange is worth half a mango
What is the value of two mangos, an orange and a banana?
9. In a chocolate factory, a machine takes a 1000g block of chocolate. It then divides this into rectangles
each weighing 10g. These rectangles are then stamped into disks of chocolate each weighing 6g with the
remaining chocolate discarded. These chocolate disks are then packed into bags of 4 which are sealed
and finally packed into boxes, each containing 6 bags ready for dispatch to the shops. What weight of
chocolate out of the original kilogram will be contained in COMPLETELY FILLED boxes (i.e. those boxes
containing a full 6 bags)? Show your work.
10. If the code for JAVA is LCXC what is the code for BASIC?
11. If the code for FORTRAN is GMUPWUU what is the code for PASCAL?
12.
Add A1 + B3 + C4 + D2 and put the result in E2. Add A3 + B1 + C2 + D4 and place the result in E4. If the
value of E4 is larger than E2 swop their contents, otherwise leave them as they are. Multiply E2 by D1,
then take away A4 and place the result in F2. What is the value of F2?
Name:____________________________________________
13.
STEP 1: Multiply C3 by D4 and store the result in F4 STEP 2: Multiply F4 by 3 then add 1 to E3. STEP 3:
Repeat STEP 2 until the value of E3 equals 3 then stop. What is the value of F4?
14. In this question you will be required to understand the symbolic coding of instructions necessary to
logically direct the “Starfire” spaceship to its various destinations.
Rules for creating instructions from the coding symbols:
 Every instruction must start with an S
 The next part of the instruction must be E, S, U, M, F, D, or A if the Starfire is leaving Earth, or
the number corresponding to the planet Starfire is departing from if it is not Earth.
 The next part of the instruction must be a number from 1 through 4 representing the cardinal
direction the Starfire is traveling. (The Starfire can only travel in a straight line in the 4 major
cardinal directions, north -1, south -2, east -3, and west -4 and can only depart from the center
of a planet but can land on any part of the planet.)
 The last part of every instruction must be the number of the planet destination code (number
and letter) plus “stop.” However if the code for the planet destination is an even number, it
must be doubled before the “stop.” Example 64E for Venus destination.
Write the code to get the Starfire from Earth to Mars. Make a new line for each line of code
required.
Name:____________________________________________
1. Read the
following
statements and
tick the box next
to the correct
answer in the
next column.
int
a = 10;
int
b = 20;
a = b;
The new values of a and b are:
a = 10
b = 10
a = 30
b = 20
a = 0
b = 10
a = 20
b = 20
a = 0
b = 30
a = 10
b = 20
a = 20
b = 10
a = 20
b =
a = 10
b = 30
a = 30
b =
0
0
none of these
2. Read the
following
statements and
tick the box next
to the correct
answer in the
next column.
int
a = 10;
int
b = 20;
b = a;
The new values of a and b are:
a = 0
b = 30
a = 30
b = 10
a = 0
b = 10
a = 20
b = 0
a = 20
b = 20
a = 20
b = 10
a = 30
b = 0
a = 10
b = 20
a = 10
b = 10
a = 10
b = 30
none of these
Did you enjoy this quiz?
Download