CPSC 110 Spring 2012 Quiz 1 (20 points)

  1. The following questions apply to the App Inventor code block shown to the right.

    1. What type of App Inventor component does this block apply to?
      1. A drawing canvas Ans = a
      2. A circle
      3. A text box
      4. A button

    2. The x and y slots are examples of _____.
      1. global variables
      2. arguments Ans = b
      3. properties
      4. procedures

    3. The global dotsize element is an example of a _____.
      1. global variable Ans = a
      2. argument
      3. property
      4. procedure

    4. What does this block do and what effect will it have on the app?

      Whenever the user touches the canvas, this block will
      draw a circle of radius dotsize
      at the location the user touched,
      which is represented by the arguments x and y.

  2. The following questions are from our reading assignments.

    1. Which of the following are examples of cloud computing? Circle all that apply. Answer: a, c, and d
      1. Creating a mobile app using App Inventor for Android.
      2. Writing a term paper using Microsoft Word.
      3. Creating a web site using Google Sites.
      4. Maintaining one's Facebook site.
      5. Creating an Excel spread sheet to figure your taxes.


    2. Moore's Law ____________.
      1. is the observation that the number of transistors that can be placed on a computer chip doubles roughly every two years.
      2. is a growth rate that is unseen in other areas of technology -- e.g., air travel.
      3. has led to exponential growth in computer processing speeds.
      4. all of the above. Answer: d

     

  3. Suppose you have an App that has a button named "Click Me!" as shown on the right. When the button is clicked the app is supposed to change the button's Text property to display a message.

    According to the following code blocks, what message will be displayed as the button's Text when it is clicked? Explain

    The button will display "Hello world", which
    is the current value of the variable named greeting.




  4. The following questions are about bit strings or binary sequences.

    1. Suppose you and your friend design a code that a sequence of 5 horizontal (_) or vertical (|) lines to send messages to each other. For example, a typical message might be: _|||_. Another might be _|_|_. How many different messages can you represent with this scheme? Explain.

      This scheme can represent 32 = 25 messages. It is
      similar to a 5-bit binary sequence in that it has two possible values horizontal (0
      and vertical (1).



    2. Suppose you are using an even parity scheme to transmit data between you and your friend and you receive the bit string 0110 0111. Was the transmission ok or did it contain an error? Explain.
      This string would contain an error. In even parity it
      should have an even number of 1s but it has 5 1s.




    3. Suppose you are using an odd parity scheme and you are going to transmit the following data string: 000 1101. What value would you set the parity bit to? Explain.
      Because this is an odd parity scheme, the number of
      1s in the message should add up to an odd number. The number of
      1s in the data is already an odd number (3), therefore you would add
      a '0' as the parity bit.