Code Grammar. Syntax A set of rules that defines the combination of symbols and expressions.

Slides:



Advertisements
Similar presentations
Types and Arithmetic Operators
Advertisements

Types, Variables and Operators Computer Engineering Department Java Course Asst. Prof. Dr. Ahmet Sayar Kocaeli University - Fall 2013.
Introduction to C Programming
 2000 Prentice Hall, Inc. All rights reserved. Chapter 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line.
Java Syntax Part I Comments Identifiers Primitive Data Types Assignment.
Introduction to Programming with Java, for Beginners Primitive Types Expressions Statements Variables Strings.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.2 Expressions and Assignment Statement.
Python Programming Chapter 2: Variables, expressions, and statements Saad Bani Mohammad Department of Computer Science Al al-Bayt University 1 st 2011/2012.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 27, 2005.
JavaScript, Fourth Edition
Chapter 2: Introduction to C++.
JavaScript, Third Edition
 Three permissible styles of comments  line comments  e.g. //comments on a line by themselves  block comments  e.g. /*comments on one line or can.
Basic Elements of C++ Chapter 2.
1 Chapter Two Using Data. 2 Objectives Learn about variable types and how to declare variables Learn how to display variable values Learn about the integral.
CPS120: Introduction to Computer Science Lecture 8.
CSC 125 Introduction to C++ Programming Chapter 2 Introduction to C++
Chapter 2: Basic Elements of Java J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
Programming in Python Part I Dr. Fatma Cemile Serçe Atılım University
2440: 211 Interactive Web Programming Expressions & Operators.
Chapter 2 Basic Elements of Java. Chapter Objectives Become familiar with the basic components of a Java program, including methods, special symbols,
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
Chapter 2: Using Data.
Computer Programming TCP1224 Chapter 4 Variables, Constants, and Arithmetic Operators.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
/* Documentations */ Pre process / Linking statements Global declarations; main( ) { Local Declarations; Program statements / Executable statements; }
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
Copyright © 2012 Pearson Education, Inc. Chapter 2: Introduction to C++
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
CSC 107 – Programming For Science. Announcements  Memorization is not important, but…  … you will all still be responsible for information  Instead.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 2: Variables & Data Types.
November 1, 2015ICS102: Expressions & Assignment 1 Expressions and Assignment.
COMP 171: Data Types John Barr. Review - What is Computer Science? Problem Solving  Recognizing Patterns  If you can find a pattern in the way you solve.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 2: Introduction to C++
VARIABLES, CONSTANTS, OPERATORS ANS EXPRESSION
Python Primer 1: Types and Operators © 2013 Goodrich, Tamassia, Goldwasser1Python Primer.
1.3 Open Sentences A mathematical statement with one or more variables is called an open sentence. An open sentence is neither true nor false until the.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Data Tonga Institute of Higher Education. Variables Programs need to remember values.  Example: A program that keeps track of sales needs to remember.
CSI 3125, Preliminaries, page 1 Data Type, Variables.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Values, Types, and Variables. Values Data Information Numbers Text Pretty much anything.
CMSC 202 Java Primer 1. July 24, 2007 Copyright © 2008 Pearson Addison-Wesley 2 A Sample Java Application.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to C++
Java-02 Basic Concepts Review concepts and examine how java handles them.
Java Programming: From Problem Analysis to Program Design, Second Edition 1 Lecture 1 Objectives  Become familiar with the basic components of a Java.
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
ICS102 Lecture 1 : Expressions and Assignment King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer.
1 st Semester Module2 Basic C# Concept อภิรักษ์ จันทร์สร้าง Aphirak Jansang Computer Engineering.
COMP 14 Introduction to Programming Mr. Joshua Stough January 24, 2005 Monday/Wednesday 11:00-12:15 Peabody Hall 218.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
2.1 The Part of a C++ Program. The Parts of a C++ Program // sample C++ program #include using namespace std; int main() { cout
Java Programming: Guided Learning with Early Objects Chapter 1 Basic Elements of Java.
Bill Tucker Austin Community College COSC 1315
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
Visual Basic Variables
Expressions An expression is a portion of a C++ statement that performs an evaluation of some kind Generally requires that a computation or data manipulation.
Revision Lecture
Java Programming: From Problem Analysis to Program Design, 4e
2.1 Parts of a C++ Program.
Chapter 2: Basic Elements of Java
Algebra Vocabulary.
Statements and expressions - java
elementary programming
Chapter 2: Introduction to C++.
Primitive Types and Expressions
Variables and Constants
Presentation transcript:

Code Grammar

Syntax A set of rules that defines the combination of symbols and expressions

Curly Braces Always work in balanced pairs (an open and closed pair) Used to structure code blocks

Naming Convention Legal names can only contain letters, underscores, numbers, and the dollar sign The initial character must be a letter, underscore, or dollar sign - not a number The names you define are called identifiers Legal identifiers Illegal identifiers. Why?

Vocabulary

Comments Ignored by the computer Helps us write notes Helps remember what that part of the program does

Functions Allow us to execute certain actions like draw shapes, set colors Usually lowercase followed by parentheses

Expressions, Statements An expression o like a phrase o Often a combination of operators A statement o A set of expressions o Like a sentence o Ends with the statement terminator

Data types Processing can store and manipulate different kinds of data including numbers, letters, words, colors, etc The computer stores each in a different way so it needs to know which kind of data it is in order to manage it int integer data float floating-point numbers that have a decimal point String Words and sentences boolean True or false

Variables A container for storing data Allows a data element to be reused Every variable had a name, value and data type A variable must be declared before it is used

Operators Symbols used to write mathematical expressions + (Addition) - (Subtraction) * (Multiplication) / (Division)

Relational Operators > (greater than) >= (greater than and equal to) < (less than) <= (less than and equal to) == (equal to) != (not equal to)

References Processing: A programming Handbook for Visual Designers - Casey Reas, Ben Fry Processing: Creative Coding and Computational Art - Ira Greenberg

Op Open CodeLabs Every Wednesday, 6:00pm - 8:00pm 10th Floor Lab, Building L