Lesson 4: Controlling Memory with Variables

Slides:



Advertisements
Similar presentations
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
Advertisements

Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
Java An introduction. Example 1 public class Example1 { public static void main (String [] args) { System.out.println (“This is the first example”); int.
Introduction to a Programming Environment
C++ Programming Language Day 1. What this course covers Day 1 – Structure of C++ program – Basic data types – Standard input, output streams – Selection.
index.php Palmyra Area High School 1.
CS102 Introduction to Computer Programming
Real World Programming BBrewer Fall Programming - Bellwork 1.Log on 2.Go to edmodo 3.Open & Save Vocabulary Graphic Organizer and Analaysis Document.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Introduction to Programming. Objectives Look at why we write programs Describe some things it takes to learn to be a programmer Discuss some important.
Introduction to Python
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 6 Value- Returning Functions and Modules.
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
Computer Software Operating Systems – Programs. Computer Language - Review We learnt that computers are made up of millions of tiny switches that can.
Language Find the latest version of this document at
ALGEBRA VOCABULARY. Vocabulary: Expression Definition: A math phrase built from constants, variables and operations EXAMPLE: 3X - 2Y.
Reasoning with linear equations and inequalities Students will understand that equation is a statement of equality between two expression. Students find.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Getting Started With Python Brendan Routledge
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Chapter 1 Introduction to Programming and Visual Basic.
1 Sections 3.1 – 3.2a Basic Syntax and Semantics Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
CMSC201 Computer Science I for Majors Lecture 03 – Variables
FOP: Multi-Screen Apps
Unit 5: Canvas Painter.
CST 1101 Problem Solving Using Computers
A Playful Introduction to Programming by Jason R. Briggs
FOP: User Input & Strings
Introducing Instructions
Introduction to Event-Driven Programming
Parts of an Expression.
Lesson 1 An Introduction
Lesson 5-2 AP Computer Science Principles
1-5 Equations Goals: Solve equations with one variable
JavaScript.
Lesson 1: Buttons and Events – 12/18
Lesson 10: Building an App: Color Sleuth
Chapter 16 – Programming your App’s Memory
Starter Write a program that asks the user if it is raining today.
CIS 115Competitive Success/tutorialrank.com
CIS 115 Education for Service-- tutorialrank.com.
Lesson 2: Multi-Screen Apps
TRANSLATORS AND IDEs Key Revision Points.
JavaScript Introduction
IPC144 Introduction to Programming Using C Week 2 – Lesson 1
Learning to Program in Python
Building an App: Multi-Screen App
Lesson 8: Boolean Expressions and "if" Statements
Introduction to Python
Unit 4. Day 20..
Computers & Programming Languages
Unit 1: Introduction Lesson 1: PArts of a java program
Lesson 16: Functions with Return Values
Lesson 6: User Input and Strings
Lesson 5: Building an App: Clicker Game
HAPPY NEW YEAR! Lesson 7: If-statements unplugged
Identifying Parts of an equation
ICT Programming Lesson 4:
Topics Introduction to Value-returning Functions: Generating Random Numbers Writing Your Own Value-Returning Functions The math Module Storing Functions.
ICT Gaming Lesson 3.
Unit 3 lesson 2-5 The Need For Algorithms- Creativity in Algorithms – Simple Commands - Functions Day 18.
Programming for Computer Games
Tutorial 10: Programming with javascript
Lesson 02: Introduction to Python
Presentation transcript:

Lesson 4: Controlling Memory with Variables UNIT 5 – LESSON 4

WHEN YOU COMPLETE LESSON 4, TURN IN THE PAPER WHERE YOU MADE YOUR PREDICTIONS AND COMPUTATIONS FOR CREDIT. When you finish Lesson 4, you will go on to Lesson 5

VOCABULARY Data Type - All values in a programming language have a "type" - such as a Number, Boolean, or String - that dictates how the computer will interpret it. For example 7+5 is interpreted differently from "7"+"5" Expression - Any valid unit of code that resolves to a value. Variable - A placeholder for a piece of information that can change.

PURPOSE: Developing a good mental model for how variables work in computer programs is absolutely essential to long-term success as a programmer.

PROGRAMMING IS NOT MATH The = sign in programming is an instruction to store a value in memory, NOT a statement of equality. “Variables” in computer programming are just named pieces of memory, NOT unknowns in an equation or symbols for undetermined values.

Recall patterns in making event-driven apps. Add UI elements to the screen. Give the UI elements meaningful IDs. Add event handlers to those elements.

 App Lab already keeps track of a lot of things for you in memory without you doing anything, like the position and styling of elements on the screen, especially if they are moving around. But you will want to write programs that keep track of data that’s not “built-into” the programming environment. These apps use and control the computer’s memory to do this, and learning how to use memory in programs is a powerful skill to have. Today we’ll start!

The programming tasks in this lesson acquaint you with basics of working with variables and building up a mental model for how programs use and manage memory. To keep things simple, the output will mostly be simple text displayed to the app screen or debug console. In the next lesson we’ll apply what you learn to an app for a simple game.

WATCH: Tutorial - Introduction to Variables Part 1 - Video (download) Tutorial - Introduction to Variables Part 2 - Video (download)

To get credit for Unit 5, Lesson 4, Complete the entire lesson and Turn in the paper you worked stuff out on. Then go on to Unit 5, Lesson 5