CS108 Spring 2014 Week 3: Quiz

advertisement
CS108 Spring 2014
Week 3: Quiz
1) Joan is creating a computer model. She is modeling how a person drives a car.
Which list is most likely to give the level of abstraction she needs?
a)
b)
c)
d)
e)
***Mirrors, Accelerator, Break and Indicator gauges.
Carburetor, Alternator, Transmission, Fuel Delivery System, and Battery.
Tires, Axles, Drive Shaft, and Drive Train.
Straps, Bolts, Nuts, Belts and Wires.
Plastics, Metals, and Fibers of which all the parts of the car are made.
2) Which best describes the process of abstraction in computer modeling?
a) Finding and fixing all the places in the model that can cause the model to
either “crash” or give incorrect results.
b) Developing a program that is good enough to handle the many special cases
that arise in the model.
c) Developing data structures that can efficiently use the data in the model.
d) ****Deciding which aspects of the real world are most important to the when
creating your model.
e) Describing how the model works so that people can use and extend the
model.
3) In the RGB color representation which of the colors below has the same value for its
R, G and B?
a)
b)
c)
d)
e)
Medium Yellow
Sky Blue
***Light Gray
Orange
Light Purple
Document1
4) In a computer program, when a sequence of instructions is executed over and over
again the sequence is called _________.
a)
b)
c)
d)
e)
***A loop
Redundant
Very, very dead
Confused
Inefficient
5) In a computer program, the number of times a sequence of instructions is executed
is called the number of __________.
a)
b)
c)
d)
e)
***Iterations
Redundancies
Repeats
Statements
Loops
6) What are the three types of loops in most programming languages?
a) Repeat, Infinite, Counted
b) ***Infinite, Conditional, Counted
c) Iteration, Conditional, Fixed.
d) Fixed, Floating, Infinite
e) Finite, Infinite, Simi-infinite
7) In the NetLogo programming language, what is a variable?
a) A number that does not change while the program is running.
b) ***A computer memory location that is given a name by the programmer and
holds a value that can be changed as the program executes.
c) Either x, y, or z.
d) Any single letter of the English alphabet (a through z).
e) Something that is likely to change or vary; subject to variation; changeable;
Inconstant; fickle.
8) In a computer program, what is a local variable?
a) A variable that is named after local industries or crops.
b) Everything that changes in the program.
c) ***A variable that can only be accessed or changed within a limited block of
the program such as within a procedure.
d) A variable that affects every agent of the program.
e) A variable that can only affect one agent of the program.
Document1
9) What the three rules will result in the emergent behavior of flocking birds?
a) Keep angle to sun constant. Go in the same direction of neighbors. Avoid
predators.
b) Avoid predators. Travel south in late autumn. Find food.
c) Don’t fly outside the flock. Avoid predators. Fly forward.
d) ***Go in the same direction as your neighbors. Don’t get too near to or too far
from your neighbors. Avoid predators.
e) Travel with the strongest winds in both late autumn and early spring. Find
Food, Avoid predators.
10) In Blown to Bits, Internet Protocol (IP) is described as the neck of Internet
Architecture Hourglass. Why?
Minimum Answer: Because all information is turned into Internet Protocol or IP packets
so that it can be transferred over the Internet.
Document1
Download