CPSC 110-08: Computing with Mobile Phones

Reading: App Inventor, Create Your Own Apps, Chapter 20
Due: Friday 9/30 (before class)

Textbook

You can purchase a copy of the text book Wolber, Abelson, Spertus, and Looney, App Inventor: Create Your Own Android Apps. It costs around $25. We will be having reading assignments from this text throughout the semester.

There is a pre-publication version of this book available for free download. However, it is not as complete as the published version.

Reading Assignment

Principles addressed: Algorithms: loops Programming:
Read Chapter 20, Repeating Blocks, focusing in particular on the simple for each and while loop sections. This chapter describes the looping control structures, important elements in designing algorithms.

    Reading Questions. Provide answers to the following two questions on a Portfolio page for this reading assignment.

  1. Consider the following Pseudocode algorithm. What would be the value stored in Count as a result of this algorithm. To determine this answer, you should hand trace the algorithm, keeping track of how the values of N and Count change.
    Set N to 100
    Set Count to 0
    While N > 0 do:
      Set N to N - 20
      Set Count to Count + 1
    

  2. Construct a set of App Inventor Blocks to test your answer to the previous question. Test your code by right clicking on blocks and using the Watch and Do it options. (Remember that to use those options your app must be running on the emulator or phone.) Provide a screen shot of your blocks as your answer to this question.

  3. Complete this exercise from the Algorithms Lecture, reprinted here:

In Class on Friday

We will go over these and look at examples that use loops.