Loops, Databases, Procedures, and Lists

Slides:



Advertisements
Similar presentations
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Advertisements

Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
CATHERINE AND ANNIE Python: Part 3. Intro to Loops Do you remember in Alice when you could use a loop to make a character perform an action multiple times?
String and Lists Dr. Benito Mendoza. 2 Outline What is a string String operations Traversing strings String slices What is a list Traversing a list List.
Programming with App Inventor Storing Data
ISBN Chapter 10 Implementing Subprograms.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
Introduction to AppInventor Dr. José M. Reyes Álamo.
1 CS101 Introduction to Computing Lecture 29 Functions & Variable Scope (Web Development Lecture 10)
EMT1111 Logic and Problem Solving Dr. José M. Reyes Álamo Lecture 1.
COP1220/CGS2423 Introduction to C++/ C for Engineers Professor: Dr. Miguel Alonso Jr. Fall 2008.
EMT1111 Logic and Problem Solving Dr. José M. Reyes Álamo Lecture 1.
COMPUTER PROGRAMMING. Control Structures A program is usually not limited to a linear sequence of instructions. During its process it may repeat code.
EMT1111 Logic and Problem Solving Dr. José M. Reyes Álamo Lecture 1.
Variables, operators, canvas, and multimedia Dr. José M. Reyes Álamo.
Loops, Databases, Procedures, and Lists Dr. José M. Reyes Álamo.
Functions, Procedures, and Abstraction Dr. José M. Reyes Álamo.
PHP Constructs Advance Database Management Systems Lab no.3.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Software Engineering Principles Dr. José M. Reyes Álamo.
Variables, operators, canvas, and multimedia Dr. José M. Reyes Álamo.
Language Find the latest version of this document at
Python 1 SIGCS 1 Intro to Python March 7, 2012 Presented by Pamela A Moore & Zenia C Bahorski 1.
Variables, operators, canvas, and multimedia Dr. Reyes.
Introduction to Logic and Conditional Block Dr. José M. Reyes Álamo.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
String and Lists Dr. José M. Reyes Álamo. 2 Outline What is a string String operations Traversing strings String slices What is a list Traversing a list.
PHP using MySQL Database for Web Development (part II)
String and Lists Dr. José M. Reyes Álamo.
Outline lecture Revise arrays Entering into an array
Pamela Moore & Zenia Bahorski
GC211Data Structure Lecture2 Sara Alhajjam.
Iterative Constructs Review
CS101 Introduction to Computing Lecture 19 Programming Languages
UNIT - V STORED PROCEDURE.
C-language Lecture By B.S.S.Tejesh, S.Neeraja Asst.Prof.
Lecture 2 of Computer Science II
CSCI1600: Embedded and Real Time Software
VISUAL BASIC.
Component-Level Design
Functions, Procedures, and Abstraction
Variables, operators, canvas, and multimedia
16. Controlling Loops CSC-3004 Introduction to Software Development
Working with Databases (I) 靜宜大學資管系 楊子青
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Algorithm Discovery and Design
String and Lists Dr. José M. Reyes Álamo.
CS285 Introduction - Visual Basic
Introduction to Problem Solving and Control Statements
Programming We have seen various examples of programming languages
Processor Fundamentals
Implementing Subprograms
Introduction to AppInventor
Training & Development
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
CS 1111 Introduction to Programming Spring 2019
Unit 3 lesson 2-5 The Need For Algorithms- Creativity in Algorithms – Simple Commands - Functions Day 18.
CISC101 Reminders All assignments are now posted.
Programming Lists of Data 靜宜大學資管系 楊子青
Data Structures & Algorithms
Vocabulary Memory Cards--Sample
Predefined Functions Revisited
PHP an introduction.
Web APIs In computer programming, an application programming interface (API) is a set of subroutine definitions, protocols, and tools for building application.
CSCI1600: Embedded and Real Time Software
Functions, Procedures, and Abstraction
Top-Down Design with Functions
Martin Rinard, Jiasi Shen, Varun Mangalick
Software Engineering and Animations
Presentation transcript:

Loops, Databases, Procedures, and Lists Dr. José M. Reyes Álamo

Outline Loops Databases Procedures Lists

Loops

Some times you need to repeat… While the test is TRUE do

Some times you need to repeat… For each element in the list do

Some times you need to repeat… For each value of i in the range of start to end on steps of step do

Databases

Permanent Storage TinyDB TinyWebDB Persistent storage in your device Persistent storage in the Web

TinyDB Grocery List Item (tag) Quantity (valueToStore) Pasta 1 Box Sauce 1 Jar

Procedures

What is a procedure? A procedure is a named sequence of blocks that encapsulate some functionality and can be called from any place in your app.

More about procedures Procedures are an abstraction since they represent a recognizable name for a sequence of lower-lever instructions. In other programming languages procedures are called functions or subprograms.

Why are procedures useful? Procedures can be a good tool to develop large apps. You create new functionality by using procedures. You can use them to break down a large problem or project into more manageable sub problems. While designing the app, you can define a procedure ignoring the details of how it works and refer to the empty procedure. When your finish your design, you can add code to the empty procedures to complete the functionality of your app. You can put chunks of code in one place and call it from various places in your app.

Two blocks to define procedures The procedure block collects a sequence of blocks together. When you create a procedure, AppInventor automatically generates a call block and places it in the My Definitions drawer. You use the call block to invoke the procedure. The procedureWithResults block works similarly to procedure but also returns a result. After the procedure executes, the result is returned to the block connected to the return socket.

Refactoring

Refactoring Refactoring is programming technique that consist on reorganizing the code, for example create a procedure to substitute redundant code, to make it easier to maintain and easier for the programmers to work with.

Lists

What is a list? They are variables that instead of holding a single value, they hold several values distinguished by an index. Simple variables score = 100 phoneNumber = 201-122-4322 Lists bestScores = [100, 98, 89] myContactsPhoneNumbers = [201-122-4322, 803-234-3293, 977-121-5383]

What is a list? Simple variables Lists score = 100 phoneNumber = 201-122-4322 Lists bestScores = [100, 98, 89] myContactsPhoneNumbers = [201-122-4322, 803-234-3293, 977-121-5383]

List operations

OpenLab and Blackboard Finish your labs and post them in OpenLab. Finish quizzes on Blackboard. Work on your Project. Study for the Final Exam.