Mini-Project: 

Math Operations

18

Getting Started

A. Download the Starter Code

B. In AppInventor, click on the Projects drop down menu 


For each of the following problems, code the solution in the Blocks Editor. Then run and test your solution. Keep running and testing until you are certain that it is correct. Each problem should have its solution displayed in the specific label for it. 

Goals & Requirements

0. Rename the Screen1.Title to your name. 

1. Compare to 100. Write an app that compares the value input to 100. 

It should only display the correct case: equal to, less than, or greater than.

2. Is it odd/even. Write an app that tests whether the value input by the user is odd.

3. Divisible By. A number N is divisible by M if the remainder of N divided by M is 0. All even numbers are divisible by 2. Modify the app to test whether N is divisible by 2, 3, and 5. Some numbers, 30, will be divisible by all three, and some, 17, will be divisible by none. 

4. Movie Ticket. Suppose that N represents a person’s age and we want to categorize the person as a youth, adult, or a senior. A senior is a person who is 65 or older. A youth is anyone younger than 18. Display the decision about the person’s category. 

5. Ones digit. Display only the ones digit of N.


Hint: Use remainder when dividing by a number.

6. Binary. Display the binary representation of the decimal number entered.




Entire completed app should match the results below.

7. Extra Credit: Style the app nicely. Make the app have a better style. One hint could be to have each test section a different color. 

Be creative!

8.  Super Duper Extra Credit: Make a function that calculates the greatest common factor of two variables.

Show TClark your completed app, then turn in all the files in the form.