Windows Programming, C.-S. Shieh, KUAS EC, 20051 Chapter 3 Operators and Expressions.

Slides:



Advertisements
Similar presentations
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Advertisements

Chapter 3 DATA: TYPES, CLASSES, AND OBJECTS. Chapter 3 Data Abstraction Abstract data types allow you to work with data without concern for how the data.
Types, Variables and Operators Computer Engineering Department Java Course Asst. Prof. Dr. Ahmet Sayar Kocaeli University - Fall 2013.
Data Types and Expressions
©2004 Brooks/Cole Chapter 2 Variables, Values and Operations.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Introduction.
Review Binary –Each digit place is a power of 2 –Any two state phenomenon can encode a binary number –The number of bits (digits) required directly relates.
Chapter 2 Data Types, Declarations, and Displays
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Introduction to programming Language C, Data Types, Variables, Constants. Basics of C –Every program consists of one or more functions and must have main.
2015/8/221 Data Types & Operators Lecture from (Chapter 3,4)
Chapter 2: C Fundamentals Dr. Ameer Ali. Overview C Character set Identifiers and Keywords Data Types Constants Variables and Arrays Declarations Expressions.
A Variable is symbolic name that can be given different values. Variables are stored in particular places in the computer ‘s memory. When a variable is.
Java Primitives The Smallest Building Blocks of the Language (corresponds with Chapter 2)
Information and Programs. Foundations of Computing Information –Binary numbers –Integers and Floating Point –Booleans (True, False) –Characters –Variables.
Copyright © 2002 W. A. Tucker1 Chapter 7 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Binary, Decimal and Hexadecimal Numbers Svetlin Nakov Telerik Corporation
Chapter 3 Section 1 Number Representation Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation.
1 Do you have a CS account? Primitive types –“ building blocks ” for more complicated types Java is strongly typed –All variables in a Java program must.
Simple Data Types and Statements. Namespaces namespace MyNamespace { // …. { MyNamespace::func1() using namespace OtherNamespace; Comments: // /* xxxx.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 3A Integral Data (Concepts)
Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (1/3) Arduino Programming Language Chin-Shiuh Shieh ( 謝欽旭 ) Department.
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
Bits, Bytes, and Integers Topics Representing information as bits Bit-level manipulations Boolean algebra Expressing in C Representations of Integers Basic.
Lecture 3: The parts of a C++ program (Cont’d) Professor: Dr. Miguel Alonso Jr. Fall 2008 CGS2423/COP1220.
At the end of the module the students should be able to:  Familiarize themselves with the different uses of constants, operators, and expressions in.
Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved Chapter 2 Elementary Programming.
VARIABLES, CONSTANTS, OPERATORS ANS EXPRESSION
Primitive Variables.
 All C programs are made up of functions that perform operations on variables.  In this lecture we examine variables  Variables are the basic building.
Chapter 3 – Variables and Arithmetic Operations. Variable Rules u Must declare all variable names –List name and type u Keep length to 31 characters –Older.
Programming with Visual C++: Concepts and Projects Chapter 3A: Integral Data (Concepts)
Copyright © – Curt Hill Types What they do.
Java Programming, Second Edition Chapter Two Using Data Within a Program.
NUMBER SYSTEMS AND CODES. CS Digital LogicNumber Systems and Codes2 Outline Number systems –Number notations –Arithmetic –Base conversions –Signed.
A: A: double “4” A: “34” 4.
Department of Electronic & Electrical Engineering Expressions operators operands precedence associativity types.
Characters and Strings
INTRODUCTION TO ‘C’ PROGRAMMING BY Prof. P. PADMANABHAM M.Tech (AE), M.Tech(CS), Ph.D(CS)-FIETE, FIE Director Academics, Bharat Institute Of Engineering.
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.
Department of Electronic & Electrical Engineering Lecture 3 IO reading and writing variables scanf printf format strings "%d %c %f" Expressions operators.
Operators A binary operator combines two values to get one result: x OP y where OP is any binary operators such as +, -, *, /, ==, !=, >, &&, or even =.
Chad’s C++ Tutorial Demo Outline. 1. What is C++? C++ is an object-oriented programming (OOP) language that is viewed by many as the best language for.
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
1 Identifiers: Names of variables, functions, classes (all user defined objects), Examples: a b gcd GCD A COSC1373 TAX Tax_Rate Tax Rate if else while.
Basic Data Types อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 4.
 Type Called bool  Bool has only two possible values: True and False.
Section 3 Review Mr. Crone.
Chapter 4 – Fundamental Data Types
Java Programming: From Problem Analysis to Program Design, 4e
Review Operation Bingo
Introduction to Programming
Introduction to Abstract Data Types
Variables Kingdom of Saudi Arabia
Basics of ‘C’.
Bits and Bytes Topics Representing information as bits
Bits and Bytes Topics Representing information as bits
Bits and Bytes Topics Representing information as bits
Bits and Bytes Topics Representing information as bits
Bits and Bytes Topics Representing information as bits
Comp Org & Assembly Lang
Engineering Problem Solving with C++ An Object Based Approach
Engineering Problem Solving with C++ An Object Based Approach
Herbert G. Mayer, PSU CS Status 7/19/2015
Names of variables, functions, classes
Module 2 Variables, Data Types and Arithmetic
ECE 120 Midterm 1 HKN Review Session.
Presentation transcript:

Windows Programming, C.-S. Shieh, KUAS EC, Chapter 3 Operators and Expressions

Windows Programming, C.-S. Shieh, KUAS EC, Naming Rules for Identifiers Consist of A-Z, a-z, 0-9, and _. First character must not be 0-9. No confliction with reserved words. Case sensitive. No Chinese.

Windows Programming, C.-S. Shieh, KUAS EC, Basic Data Types C++ Builder Basic Data Types –char, int, long, float, double –bool: true or false AnsiString Type –There is no string type in C, only array of char. –AnsiString type makes string manipulation easy. AnsiString x,y,z; x=”Hello”;y=”world!”; z=x+”, ”+y;

Windows Programming, C.-S. Shieh, KUAS EC, C++ Operators Arithmetic: +,-,*,/,% Assignment: =,+=,-=,*=,/=,%=,&=,|= Relational: ==,!=,, = Logical: &&,||,! Bit-wise logic operator: &,|,~ Increment and decrement: ++,--

Windows Programming, C.-S. Shieh, KUAS EC, Data Representations ASCII –American Standard Code for Information Interchange –One byte per character Chinese Big-5 –Two byte per Chinese character

Windows Programming, C.-S. Shieh, KUAS EC, Number Systems Position-Weighted System –Decimal –Binary (10.101) 2 =2.625 –Hexadecimal (1A.2B) 16 =