Some common data types include integers, floating point numbers, characters, strings, and arrays. 4.[r]
Trang 1LESSON 05
Trang 2Overview
of Previous Lesson(s)
Trang 3Over View
Ø Interactive development environment is a software application that
provides comprehensive facilities to computer programmers for software development
Ø Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft Corporation.
Ø Developed on Net framework
3
Trang 4Over View
Ø Keywords Reserved words int, main, class, define
Ø Identifiers Programmers defined variables
Ø Variables A named storage location in the computer’s
memory for holding a piece of data.
Ø Data Types When computer programs store data in variables,
each variable must be assigned a specific data type
Some common data types include integers, floating point numbers, characters, strings, and arrays.
4
Trang 5Over View
Ø Cout >> and Cin <<
Ø A namespace is a part of the program in which certain names are recognized; outside of the namespace they’re unknown
Ø Escape Sequences /n, /t, //, /’, /” …
Ø Library Functions
Ø sqrt()
Ø rand()
5
Trang 6Over View
Ø Looping structures
Ø For loop
Ø While
Ø Do While
Ø Decision structures
Ø If
Ø If / else
Ø Switch
6
Trang 7TODAY’S LESSON
7
Trang 8Ø Operator Precedence
Ø Type Conversion and Casting
Ø Auto Keyword
Ø Discovering Types
Ø Bitwise Operators
Ø L Values and R Values
Ø Storage Duration
Ø Variable Scopes
Ø Static Variables
Ø Namespaces
8
Trang 9Operator Precedence
Ø Operator precedence orders the operators in a priority
sequence
Ø In any expression, operators with the highest precedence are always executed first, followed by operators with the next
highest precedence, and so on, down to those with the
lowest precedence of all
9
Trang 10Operator Precedence
evaluate in this order:
- (unary negation), in order, left to right
* / %, in order, left to right + -, in order, left to right
Example expression 2 + 2 * 2 – 2
evaluate first
evaluate second
evaluate third