INQ241A
Mobile Apps

Final Review

A Miniature Practice Final Exam

  1. For the following script, draw what will be displayed.

    page main ()
    initialize
    
    display
      box→use horizontal layout
      box→set horizontal algin("left")
      box→set vertical align("top")
      boxed
        box→set width(10)
        box→set height(10)
        box→set border(colors→blue, 0.1)
      end boxed
      boxed
        box→set width(10)
        box→set height(10)
        box→set border(colors→red, 0.1)
      end boxed
    end page
  2. For the following script:

    page main ()
    initialize
      ◳count := 0
    display
      boxed
        box→set width(10)
        box→set height(10)
        if ◳count = 0 then
          box→set background(colors→black)
        else
          box→set border(colors→black, 0.1)
        end if
        box→on tapped(handler)
          where handler() is
            ◳count := ◳count + 1
        end
      end boxed
    end page
    1. draw what will be displayed when the app first starts.

    2. draw what will be displayed after the user taps the button.

  3. Create a script that initially displays some text, anything you want, and a single button, side-by-side centered in the screen. Tapping the button should make the text disappear.