CS201-22 - Introduction to Programming Lecture 22 Review...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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 ; 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. Design Recipes PAY ATTENTION TO DETAIL Variables Symbolic Names i BasicPay HouseRent x Data types Whole numbers: Real Numbers (with decimal points) Character data – char – int, short, long, unsigned – float, double int = 4 bytes char = 1 byte ASCII Table Collection of same data types Arrays Arithmetic Operators Plus + Minus ­ Multiply Divide * / Modulus Operator 7 % 2 = 1 ; 100 % 20 = 0 ; a % b ; Compound Arithmetic Operators += ­= *= /= %= Compound Arithmetic Operators a = a + b ; a += b ; Logical Operators AND OR && || 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 Bit wise OR NOT Bit wise Exclusive OR & (Binary) | (Binary) ^ (Binary) ~ (unary) Sequential Construct Decision Construct Loop Construct if ( condition ) { statement ( s ) ; } If­statement if ( condition ) { statement ( s ) ; } else { statement ( s ) ; If­else } if ( a > b && c < d ) Nested if statements if ( condition ) { statement ( s ) ; if ( condition ) { statement ( s ) ; } statement ( s ) ; } While Loops while ( a > b ) { statement ( s ) ; } While Loops While loop executes zero or more times do { statement ( s ) ; } while ( condition ) ; Do ­ while Do­while loop executes one or more times Do ­ while 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 int a [ 10 ] ; a [ 0 ] ; : a [ 9 ] ; Arrays Pointers Pointers Memory address of a variable is stored inside a pointer Files and their Input / Output systems ...
View Full Document

Ask a homework question - tutors are online