Introduction to Programming

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

Dale/Weems/Headington
Chapter 4 Control Structures I. Objectives ► Examine relational and logical operators ► Explore how to form and evaluate logical (Boolean) expressions.
IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 3: Primitive Data Types.
Differences between Java and C CS-2303, C-Term Differences between Java and C CS-2303, System Programming Concepts (Slides include materials from.
1 9/20/06CS150 Introduction to Computer Science 1 Review: Exam 1.
Basic C Programming Data Types and Arithmetic Operations 01/30/15.
Assignment Operators =, +=, *= A += B means (A+B) --->A or A = (A+B) Similarly true for -=, *=, /=, and %=. The basic rule is from right to left. Never.
Primitive Types Java supports two kinds of types of values – objects, and – values of primitive data types variables store – either references to objects.
Chapter 2 Data Types, Declarations, and Displays
Programming C/C++ on Eclipe C Training Trình bày : Ths HungNM.
Bit Operations C is well suited to system programming because it contains operators that can manipulate data at the bit level –Example: The Internet requires.
Representation and Conversion of Numeric Types 4 We have seen multiple data types that C provides for numbers: int and double 4 What differences are there.
Introduction to C Language
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Outline Variables 1.
CIS Computer Programming Logic
UniMAP Sem2-08/09 DKT121: Fundamental of Computer Programming1 Introduction to C – Part 2.
CPS120: Introduction to Computer Science
UniMAP Sem1-07/08EKT120: Computer Programming1 Week2.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
Basic Java Syntax COMP 401, Spring 2014 Lecture 2 1/14/2014.
Java Language Basics By Keywords Keywords of Java are given below – abstract continue for new switch assert *** default goto * package.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Module B - Computation1/61 Module-B-Computation Variables Basic Memory Operations Expressions.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
C++ for Engineers and Scientists Second Edition
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
Quick Summary C++/CLI Basics Data Types Controls Arrays In-class assignments.
Department of Electronic & Electrical Engineering Lecture 3 IO reading and writing variables scanf printf format strings "%d %c %f" Expressions operators.
UNIMAP Sem2-07/08EKT120: Computer Programming1 Week 2 – Introduction to Programming.
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
Lecture 3.1 Operators and Expressions Structured Programming Instructor: Prof. K. T. Tsang 1.
C syntax (simplified) BNF. Program ::= [ ] Directives ::= [ ] ::= | |… ::=#include > ::=#define.
Presentation By :- Nikhil R. Anande ( ) Electronic & Communication Engineering. 3 nd Year / 5 th Semester FACULTY GUIDE : RAHIUL PATEL SIR MICROCONTROLLER.
Windows Programming Lecture 06. Data Types Classification Data types are classified in two categories that is, – those data types which stores decimal.
1Object-Oriented Program Development Using C++ Built-in Data Types Data type –Range of values –Set of operations on those values Literal: refers to acceptable.
CSE 220 – C Programming Expressions.
Introduction to C Programming
BASIC ELEMENTS OF A COMPUTER PROGRAM
Week 3 - Friday CS222.
INSPIRING CREATIVE AND INNOVATIVE MINDS
Tokens in C Keywords Identifiers Constants
Chapter 2: Problem Solving Using C++
ITEC113 Algorithms and Programming Techniques
Object Oriented Programming
EPSII 59:006 Spring 2004.
C++, OBJECT ORIENTED PROGRAMMING
BY GAWARE S.R. COMPUTER SCI. DEPARTMENT
What to bring: iCard, pens/pencils (They provide the scratch paper)
C++ for Engineers and Scientists Second Edition
Operators and Expressions
Unit 2 Programming.
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
Java - Data Types, Variables, and Arrays
Basics of ‘C’.
Lectures on Numerical Methods
B. Ramamurthy University at Buffalo
Differences between Java and C
Associativity and Prescedence
Chapter 3 Operators and Expressions
Comp Org & Assembly Lang
ENERGY 211 / CME 211 Lecture 5 October 1, 2008.
Session 1 – Introduction to Computer and Algorithm (Part 2)‏
OPERATORS in C Programming
DATA TYPES There are four basic data types associated with variables:
C Language B. DHIVYA 17PCA140 II MCA.
Programming Fundamental-1
OPERATORS in C Programming
ECE 120 Midterm 1 HKN Review Session.
Presentation transcript:

Introduction to Programming Lecture 22 Review

Bit wise Manipulation and Assignment Operator

a = a + 1 ; a += 1 ;

Bit Manipulation Operators &= Bitwise AND Assignment Operator |= Bitwise OR Assignment Operator ^= Bitwise Exclusive OR Assignment Operator

Assignment Operator a &= b ; Same as a = a & b ;

Assignment Operator a |= b ; Same as a = a | b ;

Assignment Operator a ^= b ; Same as a = a ^ b ;

Design Recipes PAY ATTENTION TO DETAIL Analyze a problem statement, typically expressed as a word problem Express its essence, abstractly and with examples Formulate statements and comments in a precise language Evaluate and revise the activities in the light of checks and tests. PAY ATTENTION TO DETAIL

Variables

Symbolic Names x i BasicPay HouseRent

Data types Whole numbers: Real Numbers (with decimal points) int, short, long, unsigned Real Numbers (with decimal points) float, double Character data char

int = 4 bytes char = 1 byte

ASCII Table

Arrays Collection of same data types

Arithmetic Operators Plus + Minus - Multiply * Divide / Modulus %

Modulus Operator a % b ; 7 % 2 = 1 ; 100 % 20 = 0 ;

Compound Arithmetic Operators += -= *= /= %=

Compound Arithmetic Operators a = a + b ; a += b ;

Logical Operators AND && OR ||

a < b ; a <= b ; a == b ; a >= b ; a > b ; Comparison Operators a < b ; a <= b ; a == b ; a >= b ; a > b ;

a = b;

if ( a = b ) //Wrong //Logical Error

a > b ; a >= b ;

Bit wise Operators Bit wise AND & (Binary) Bit wise OR | (Binary) Bit wise Exclusive OR ^ (Binary) NOT ~ (unary)

Sequential Construct Decision Construct Loop Construct

If-statement if ( condition ) { statement ( s ) ; }

If-else if ( condition ) { statement ( s ) ; } else

if ( a > b && c < d )

Nested if statements

if ( condition ) { statement ( s ) ; }

While Loops while ( a > b ) { statement ( s ) ; }

While Loops While loop executes zero or more times

Do - while do { statement ( s ) ; } while ( condition ) ;

Do-while loop executes one or more times

For Loops for ( i = 0 ; i < 10 ; i ++ ; ) { statement ( s ) ; }

i = i + 1 ; i += 1 ; i ++ ;

Switch Statement

break ; continue ;

Functions

Call by value Call by reference

Arrays

Arrays int a [ 10 ] ; a [ 0 ] ; : a [ 9 ] ;

Pointers

Memory address of a variable is stored inside a pointer Pointers Memory address of a variable is stored inside a pointer

Files and their Input / Output systems