Download presentation
Presentation is loading. Please wait.
Published byMarylou Campbell Modified over 8 years ago
1
MIT App Inventor Lesson 3 Algorithms Variables Procedures
2
Agenda Algorithms Variables ◦ numbers ◦ Text Procedures ◦ Reuse of algorithms Operators ◦ store (set) ◦ retrieve (get)
3
Software Development Consists of 2 major stages: 1. Understanding the logic of the application 2. Translating the logic into some programming language
4
Analyze and Design 1. Analyze the problem to be solved. 2. Design a solution to the problem. Algorithms – precise set of instructions to accomplish a task.
5
Code, Test, Document 3. Code (implement) your design in a language the computer and you can BOTH understand. 4. Test the program using a set of testcases (values) to ensure it will give correct results for all possible input values. 5. Document the program (internal/external). 6. Maintain the program when needed.
6
Algorithms Common Everyday Algorithms ◦ Cooking recipes ◦ Directions to a location ◦ Math operations (division etc…)
7
Software Design Techniques IPO chart ◦ Text based chart showing ◦ Input, Processing, Output components of design Flowchart ◦ A visual representation of algorithms. Pseudocode ◦ English-like text description of algorithms
8
Problem Under Consideration Write a program to calculate a person's age in seconds. 1. Create an IPO chart to create a design.
9
IPO Chart InputProcessingOutput age (in years)Calculate the number of seconds. days age x 365 hours days x 24 minutes hours x 60 seconds minutes x 60 seconds
10
Variables Numbers or Text Global ◦ available throughout app/screen Use prefix var Good habits store all user input into variables and avoid re-reading values from GUI components create a variable for any output before setting the GUI property
11
Procedures named set of blocks Useful for common algorithms Must be defined Can be called from any other block
12
Procedures Definition Call
13
Lab 3 – Get the Message Objective Create a program to determine the age of a person based on their year of birth. The application will also request the user's first name, last name, and it will display and announce their name and age within a complete sentence. ◦ Components Button TextBox Screen Arrangement ◦ Concepts Text methods Math methods Procedures ◦ Algorithms see lab instructions
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.