Variables Here we go.

Slides:



Advertisements
Similar presentations
 Variables  What are they?  Declaring and initializing variables  Common uses for variables  Variables you get “for free” in Processing ▪ Aka: Built-in.
Advertisements

Constants and Data Types Constants Data Types Reading for this class: L&L,
VARIABLES: Your Own Piece of the ram. Why Use Variables? To save a piece of data in memory To save a piece of data in memory To store results of a calculation.
CIS 234: Using Data in Java Thanks to Dr. Ralph D. Westfall.
Declaring Variables You must first declare a variable before you can use it! Declaring involves: – Establishing the variable’s spot in memory – Specifying.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Storing data Getting data out Data types Ruby as a foundation Program Variables Click icon to hear comments (the download may take a minute)
CSCI 1100/1202 January 16, Why do we need variables? To store intermediate results in a long computation. To store a value that is used more than.
1 Please switch off your mobile phones. 2 Data Representation Instructor: Mainak Chaudhuri
2440: 211 Interactive Web Programming Expressions & Operators.
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
5 BASIC CONCEPTS OF ANY PROGRAMMING LANGUAGE Let’s get started …
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
Variables and Functions. Open your Encoder program Let’s begin by opening the “Labyrinth Auto Straight” code. Save this file as Labyrinth with variables.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
CS346 Javascript -3 Module 3 JavaScript Variables.
Primitive Data Types. Identifiers What word does it sound like?
Variables Art &Technology, 3rd Semester Aalborg University Programming David Meredith
Variables in Java x = 3;. What is a variable?  A variable is a placeholder in memory used by programmers to store information for a certain amount of.
Repetition. Loops Allows the same set of instructions to be used over and over again Starts with the keyword loop and ends with end loop. This will create.
Variables Hold information that may be manipulated, used to manipulate other information or remembered for later use A storage location in memory (RAM)
1.2 Primitive Data Types and Variables
A: A: double “4” A: “34” 4.
Values, Types, and Variables. Values Data Information Numbers Text Pretty much anything.
 Variables can store data of different types, and different data types can do different things.  PHP supports the following data types:  String  Integer.
Primitive Data Types 1 In PowerPoint, point at the speaker icon, then click the "Play" button.
DATA TYPES, VARIABLES AND CONSTANTS. LEARNING OBJECTIVES  Be able to identify and explain the difference between data and information  Be able to identify,
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
Data Types Mr Tottman Link. Data Types Programs need to use data for calculations and for output to various devices The best programs will always use.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Constants, Data Types and Variables
Chapter 3 Using Variables, Constants, Formatting Mrs. UlshaferSept
Copyright © Texas Education Agency, Computer Programming Variables and Data Types.
Choosing Data Types Database Administration Fundamentals
Chapter # 2 Part 2 Programs And data
Week 2 - Wednesday CS 121.
CST 1101 Problem Solving Using Computers
IGCSE 4 Cambridge Data types and arrays Computer Science Section 2
Variables Mr. Crone.
LESSON 2 Basic of C++.
Unit 2 Smarter Programming.
Computer Science 3 Hobart College
Lesson Two: Everything You Need to Know
JavaScript.
Variables ,Data Types and Constants
Time Manager Class Activity Material Manager Writer leader Communicator Programmer Start a journey from the capital AbuDhabi to Alasmaa School using your.
Chapter 2.
IDENTIFIERS CSC 111.
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
2.1 Parts of a C++ Program.
Computers & Programming Languages
Chapter 2: Java Fundamentals
Variables Kevin Harville.
Chapter # 2 Part 2 Programs And data
CHAPTER FOUR VARIABLES AND CONSTANTS
Chapter 2: Introduction to C++.
JavaScript.
B065: PROGRAMMING Variables 1.
Introduction to Primitives
Variables and Computer Memory
Unit 3: Variables in Java
Java: Variables, Input and Arrays
CHAPTER 2 BASIC JAVASCRIPT INSTRUCTIONS
Data Types and Maths Programming Guides.
An Introduction to Programming
Millennium High School Agenda Calendar
C Programming Lecture-3 Keywords, Datatypes, Constants & Variables
Variables and Constants
Section 6 Primitive Data Types
Presentation transcript:

Variables Here we go

How does a computer remember things? To make our programs remember things, we store information as “variables” Work the same way as variables in math go x = 5; x = 20; bestName = “Guzy”;

Computers have memory? Each variable stores its value in MEMORY, in a reserved spot of a specific size Different variable types require different memory sizes So we must DECLARE a variable to reserve the spot before we can use it to store information

Variable types INTEGER- Integer numbers, positive AND negative. But no decimals. STRING- Stores words, names, even novelty license plates like “1WOOO1” CHAR- Characters, single letters, or number, or symbols. FLOAT or DOUBLE- Decimals, take up a huge amount of space compared to integers BOOLEAN- True or False values (more on this another time)

Special quirk of javascript Is what we call “Loosely typed”, we make variables without stating what type they are You can declare a variable, and give it any type later on To declare a variable: var myVar; var myVar = “Guzy”; var myVar = new String;

TO DO Declare 6 variables at the top Make 3 of each: INTEGER, STRING in the INIT section of the code, using names and made up grades Display on the screen using the fillText command the following: Each name with the corresponding grade, 1 line per person Calculate the average