Welcome to Computer Programming

AppLab Assignments

Section 1

1-1 Change Background

Create an app with 2 buttons.  The buttons when clicked will change the background of the screen red or green. 


  • Do the same thing with one button
  • Have it change to two random colors
  • Have the button color be the next color that the screen will turn
  • Have the button move around screen randomly


1-2 Bigger

Create an app as shown above.  The thumbs up (an image in the library) with the label will be under the bigger number.  The thumb is not shown until the button is pressed.


  • Have a thumbs down next to the lower number
  • If it is a tie, have some image that represents that.
  • Get rid of the button and if the numbers change, the button is shown.



1-3 Simple Calculation

Create an app where there is 2 labels, 1 textfield and a button.  The idea is a user will put their age and you will calculate how many years older I am then you.  For basic version - assume I am older than you (Im 40).


  • Have it allow older or younger people.
  • Have it say one of three jokes (randomly) afterwards (IE, Mr. Borland is older than dirt).
  • Have a slider allow user input.



2-1 Tip Calculator

Notice, the image shown is for advanced, the basic version uses .20 for the tip rate.  Create an app that looks like above (but basic version does not need tip rate).  The idea is a user will put in their meal price and the app will calculate the tip and total amount.


  • have it be a dropdown for 10%, 15% and 20% tip rates
  • Have it round to the nearest dollar for tip
  • Another option to split the bill, so many ways (ie if there are 4 people, each person puts in ___ ), maybe this appears on another screen


2-2 BMI Calculator (Body Mass Index) [optional]

Create a bmi calculator (see here for formula) that will take in height and weight and find the BMI (Body Mass Index).   This is a level of how underweight or overweight someone is.  Here is the table of levels.  You will have  4 screens.  One for the input, one for underweight, healthy weight, overweight (so if bmi is 25+).  The screens for underweight, healthy weight, overweight will say their BMI and what they should do (eat more, eat less)


3-1 Click Me Game

Create a game where there is a button on the screen that every .5 seconds will move to a new random location.  The object of the game is to see how many times you can hit it.  Your score (how many times you hit it) will appear at the bottom of the screen.  After it moves 10 times, the game is over. 


3-2 Car Scene (DO 3-2 or 3-3)

Create an app that has 3 cars that move across as above.  When the car gets to one side, it will reappear back on left side and go again.

  • Find an image of a car online and put three of them in your design
  • For just one, see if you can get the car moving to the right.  See video.
  • Now if its goes of the screen, have it appear again on left side. See video.
  • Now make a function and call that function for each car.  See video.



3-3 Phone Explosion (DO 3-2 or 3-3)

Create a game where it looks like above.  An image of a bomb or something with a text input on it.  There will be a button below.  The idea of the game is the user will have 10 seconds to guess the password.  At the bottom there will be a timer showing how much time left.  Setup the design then:

  • You will need two variables at the top,
    • one called luckyNumber that is a random number (between 1000 and 9999)
    • one called timeLeft that starts at 10.
  • add a timer, so every second, the time left goes down by one and that info is shown at the bottom of the screen ("You have 9 seconds remaining") [video on timer]
  • when they click the button to guess, tell them if they are higher or lower than your lucky neighbor.  If they get it, have it do something special, maybe:
    • have the timer say - You did it (try to make it have the timer turn off)
    • have a new screen that says - You saved your phone - nice
  • If they fail to get it right, the bomb goes off, figure out what that means.