CS108l computer Science for All Week 6: Actual Quiz Questions



Download 20.24 Kb.
Date09.06.2017
Size20.24 Kb.
#20119
CS108L Computer Science for All

Week 6: Actual Quiz Questions


  1. Why do modelers use abstraction to create models and simulations?




  1. Modelers use abstraction to make things easier to draw.

  2. Modelers use abstraction because making things abstract to make things more difficult to understand so it keeps it private.

  3. ***Modelers use abstraction to simplify a problem so that it can be modeled.

  4. Modelers use abstraction to make things more beautiful.

  5. Modelers use abstraction to clarify the solutions to a problem.



  1. What is a variable in computer science?




  1. A variable is something that changes like the weather.

  2. *** A variable is a memory storage location referenced by a name and containing a value that can be used and changed.

  3. A variable is the part of the code that changes by itself.

  4. A variable is a change in the programming language used when creating a program.

  5. A variable is the letter x.



  1. What is a local variable?




  1. A variable that can only be used by one agent.

  2. ***A variable that can only be used in the procedure or command block where it is declared.

  3. A variable that contain information about agents in the local environment.

  4. A variable that is of interest to locals.

  5. A variable that can only be used by local agents.



  1. What is an agent variable?




  1. ***A variable where each agent has its own separate memory location for that variable.

  2. A variable where an agent must be on the patch where the variable is created.

  3. A variable that tells a patch which turtles it contains.

  4. A variable that tells a patch which agents it contains.

  5. A variable that is transferred between different agents.



  1. What is a global variable?

  1. A variable can hold many different values at the same time.

  2. A variable that can only be accessed from outside the program.

  3. ***A single chunk of memory that is shared by and can be accessed by all parts of a program.

  4. A variable used in models that affects the whole world such as climate models, human population models and models of the ocean currents.

  5. A variable that can only be used in the procedure in which it was declared.



  1. In NetLogo, what four ways can be used to input global variables from the Interface tab?




  1. ***Slider, Switch, Chooser and Input Box.

  2. Slider, Changer, Chooser and Plot.

  3. Switch, Changer, Monitor and Input Box.

  4. Switch, Monitor, Plot and Chooser.

  5. Slider, Switch, Monitor and Plot.



  1. What is the shape of the NetLogo world when both horizontal and vertical wrapping is turned on?

  1. A sphere

  2. ***A torus (doughnut)

  3. A square

  4. A kite shape

  5. A cube



  1. What is a Radio Frequency Identification tag (RFID)

  1. An electronic identification system that can only be used for official government purposes on important items.

  2. A sequence of 4 letters used to identify both public and private radio stations.

  3. ***Something containing electronically stored information that can be both powered from a few feet away and read from a few feet away.

  4. Silicon chips embedded in plastic that require small batteries or some other internal power source to transmit their ID number.

  5. A radio that has a tag that can be used to identify the station that is playing.



  1. In the following segment of NetLogo code, the programmer intended that each turtle would keep track of its energy. Each turtle is supposed to start with energy equal to 100 and lose 0.05 energy each time the “go” procedure is called. Assume that the program also contains a “setup” procedure (called before the go procedure) and a “moveTurtle” procedure. What is the error in this “go” procedure?



turtles-own [energy]
to go

set energy (energy - 0.05)

ask turtles

[

moveTurtle

]

end


  1. ***A turtle’s energy cannot be set outside of ask turtles [ ]

  2. The parentheses in the set command must be removed.

  3. The procedure must first set the energy to 100.

  4. Each turtle is not losing energy as it is walking.

  5. The parentheses in the set command must be replaced with square brackets.




  1. In a NetLogo program with max-pxcor = 10, max-pycor = 10 and the location of the origin at the center, what is the value of the variable myCount after the setup procedure below is called?


to setup

clear-all

let myCount 0

ask patches

[

if (myCount < 50)

[

set pcolor red

set myCount (myCount + 1)

]

]

show myCount

end


  1. 0

  2. 1

  3. 10

  4. ***50

  5. 100




Download 20.24 Kb.

Share with your friends:




The database is protected by copyright ©ininet.org 2024
send message

    Main page