SlideShare a Scribd company logo
Migration: C to C++ 09/09/2009 1 Hadziq Fabroyir - Informatics ITS
C/C++ Program Structure Operating System void function1() { 	//... 	return; } int main() { 	function1(); 	function2(); 	function3(); 	return 0; } void function2() { 	//... 	return; } void function3() { 	//... 	return; } Operating System
Naming Variable MUST Identifier / variable name can include letters(A-z), digits(0-9), and underscore(_) Identifier starts with letteror underscore Do NOT use keywordsas identifier Identifier in C++ is case-sensitive CONSIDER Usemeaningfullname Limit identifier length up to 31 characters, although it can have length up to 2048 Avoid using identifiers that start with an underscore 09/09/2009 Hadziq Fabroyir - Informatics ITS 3
Keywords 09/09/2009 Hadziq Fabroyir - Informatics ITS 4
Declaring Variable 09/09/2009 Hadziq Fabroyir - Informatics ITS 5 int value; char[] firstName; Char[] address;	 int 9ball; long bigInt; System::String full_name; int count!; long class; float a234_djJ_685_abc___;
Initializing Variable int value = 0;					 char[] firstName = “Budi”;				 long bigInt(100L); System::String^ full_name = “Budi Lagi”; 09/09/2009 Hadziq Fabroyir - Informatics ITS 6
Fundamental Data Types 09/09/2009 Hadziq Fabroyir - Informatics ITS 7
Literals 09/09/2009 Hadziq Fabroyir - Informatics ITS 8
Example of Data Types int main() { 	char c = 'A'; 	wchar_t wideChar = L'9'; 	int i = 123; 	long l = 10240L; 	float f = 3.14f; 	double d = 3.14; 	bool b = true; 	return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 9
Enumerations Variable with specific sets of values Enum Day {Mon, Tues, Wed, Thurs, Fri, Sat, Sun}; Day today = Mon; Enum Day {Mon = 1, Tues, Wed, Thurs, Fri, Sat, Sun}; Day nextDay = Tues; 09/09/2009 Hadziq Fabroyir - Informatics ITS 10
Basic Input/Output Operations int main() { 	//declare and initialize variables 	int num1 = 0; 	int num2 = 0; 	//getting input from keyboard 	cin >> num1 >> num2; 	//output the variables value to command line 	cout << endl; 	cout << "Num1 : " << num1 << endl; 	cout << "Num2 : " << num2; 	return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 11
Escape Sequence 09/09/2009 Hadziq Fabroyir - Informatics ITS 12
Basic Operators int main() { 	int a = 0; 	int b = 0; 	int c = 0; 	c = a + b; 	c = a - b; 	c = a * b; 	c = a / b; 	c = a % b; 	a = -b;	 	return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 13
Bitwise Operators 09/09/2009 Hadziq Fabroyir - Informatics ITS 14 &	bitwise AND ~ 	bitwise NOT | 	bitwise OR ^ 	bitwise XOR >>shift right <<shift left
Increment and Decrement Operators int main() { 	int a = 0; 	int b = 0; 	a++; 	b--; ++a; 	++b;	 	return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 15
Shorthand Operators int main() { 	int a = 0; 	int b = 0; 	a += 3; 	b -= a; 	a *= 2; 	b /= 32; 	a %= b;	 	return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 16
Explicit Casting static_cast<the_type_to_convert_to>(expression) (the_type_to_convert_to)expression 09/09/2009 Hadziq Fabroyir - Informatics ITS 17
Constant Declaration int main() { const double rollwidth = 21.0;    const double rolllength = 12.0*33.0;    const double rollarea = rollwidth*rolllength;    return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 18
Declaring Namespace namespace MyNamespace { 	// code belongs to myNamespace } namespace OtherNamespace { 	// code belongs to otherNamespace } 09/09/2009 Hadziq Fabroyir - Informatics ITS 19
Using Namespace #include <iostream> namespace myStuff { int value = 0; } int main() { std::cout << “enter an integer: “; std::cin >> myStuff::value; std::cout << “You entered “ << myStuff::value << std:: endl; return 0; } #include <iostream> namespace myStuff {            int value = 0; } using namespace myStuff; int main() { std::cout << “enter an integer: “; std::cin >> value; std::cout << “You entered “ << value<< std:: endl; return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 20
Visual C++ Programming Environment Hadziq Fabroyir - Informatics ITS ISO/ANSI C++ (unmanaged) C++/CLI .NET Framework Managed C++ Native C++ Framework Classes Native C++ MFC Common Language Runtime (CLR) Operating System HHardware 09/09/2009 21
C++/CLI Data Types 09/09/2009 Hadziq Fabroyir - Informatics ITS 22
ITC1398 Introduction to Programming Chapter 3 23 Control Structures Three control structures  Sequence structure Programs executed sequentially by default Selection structures if, if…else, switch Repetition structures while, do…while, for
ITC1398 Introduction to Programming Chapter 3 24 if Selection Statement Choose among alternative courses of action Pseudocode example If student’s grade is greater than or equal to 60      print “Passed” If the condition is true Print statement executes, program continues to next statement If the condition is false Print statement ignored, program continues
Activity Diagram 09/09/2009 Hadziq Fabroyir - Informatics ITS 25
ITC1398 Introduction to Programming Chapter 3 26 if Selection Statement Translation into C++ if ( grade >= 60 )    cout << "Passed"; Any expression can be used as the condition If it evaluates to zero, it is treated as false If it evaluates to non-zero, it is treated as true
ITC1398 Introduction to Programming Chapter 3 27 if…else Double-Selection Statement if Performs action if condition true if…else Performs one action if condition is true, a different action if it is false Pseudocode If student’s grade is greater than or equal to 60     print “Passed”Else     print “Failed”  C++ code if ( grade >= 60 )    cout << "Passed";else   cout << "Failed";
Activity Diagram 09/09/2009 Hadziq Fabroyir - Informatics ITS 28
ITC1398 Introduction to Programming Chapter 3 29 if…else Double-Selection Statement Ternary conditional operator (?:) Three arguments (condition, value if true, value if false) Code could be written: cout << ( grade >= 60 ? “Passed” : “Failed” ); Condition Value if true Value if false
ITC1398 Introduction to Programming Chapter 3 30 if…else Double-Selection Statement Nested if…else statements One inside another, test for multiple cases  Once a condition met, other statements are skipped Example              If student’s grade is greater than or equal to 90                   Print “A”              Else           If student’s grade is greater than or equal to 80	              Print “B”         Else                If student’s grade is greater than or equal to 70 	                    Print “C”	               Else 	                    If student’s grade is greater than or equal to 60 	                         Print “D”                    Else                            Print “F”
ITC1398 Introduction to Programming Chapter 3 31 if…else Double-Selection Statement Nested if…else statements (Cont.) Written In C++ if ( studentGrade >= 90 )    cout << "A";elseif (studentGrade >= 80 )       cout << "B";elseif (studentGrade >= 70 )          cout << "C";  elseif ( studentGrade >= 60 )             cout << "D";else            cout << "F";
while Repetition Statement A repetition statement (also called a looping statement or a loop) allows the programmer to specify that a program should repeat an action while some condition remains true. The pseudocode statement While there are more items on my shopping list Purchase next item and cross it off my list  09/09/2009 Hadziq Fabroyir - Informatics ITS 32
for Repetition Statement 09/09/2009 Hadziq Fabroyir - Informatics ITS 33
do …while Repetition Statement do {  statement  } while ( condition ); 09/09/2009 Hadziq Fabroyir - Informatics ITS 34
switch Multiple-Selection Statement 09/09/2009 Hadziq Fabroyir - Informatics ITS 35
For your practice … Lab Session I (Ahad, 19.00-21.00) 4.14  5.20  6.27 Lab Session II (Senin, 19.00-21.00) 4.35  5.12  6.30 09/09/2009 Hadziq Fabroyir - Informatics ITS 36
☺~ Next: OOP using C++ ~☺ [ 37 ] Hadziq Fabroyir - Informatics ITS 09/09/2009

More Related Content

What's hot

Deep C
Deep CDeep C
Deep C
Olve Maudal
 
Programming fundamental 02
Programming fundamental 02Programming fundamental 02
Programming fundamental 02
Suhail Akraam
 
C programming session 02
C programming session 02C programming session 02
C programming session 02Vivek Singh
 
Glimpses of C++0x
Glimpses of C++0xGlimpses of C++0x
Glimpses of C++0x
ppd1961
 
Unit 2 c programming_basics
Unit 2 c programming_basicsUnit 2 c programming_basics
Unit 2 c programming_basics
kirthika jeyenth
 
Programming C Part 03
Programming C Part 03Programming C Part 03
Programming C Part 03
Raselmondalmehedi
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02
Wingston
 
Object-Oriented Programming in Modern C++. Borislav Stanimirov. CoreHard Spri...
Object-Oriented Programming in Modern C++. Borislav Stanimirov. CoreHard Spri...Object-Oriented Programming in Modern C++. Borislav Stanimirov. CoreHard Spri...
Object-Oriented Programming in Modern C++. Borislav Stanimirov. CoreHard Spri...
corehard_by
 
VTU PCD Model Question Paper - Programming in C
VTU PCD Model Question Paper - Programming in CVTU PCD Model Question Paper - Programming in C
VTU PCD Model Question Paper - Programming in C
Syed Mustafa
 
Control Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, StructuresControl Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, Structures
indra Kishor
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
Mohammed Saleh
 
Basics of C porgramming
Basics of C porgrammingBasics of C porgramming
Chap 2 input output dti2143
Chap 2  input output dti2143Chap 2  input output dti2143
Chap 2 input output dti2143
alish sha
 
Overview of c++ language
Overview of c++ language   Overview of c++ language
Overview of c++ language
samt7
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language
Mohamed Loey
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
Abir Hossain
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
JavvajiVenkat
 
C if else
C if elseC if else
C if else
Ritwik Das
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
Sangharsh agarwal
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manual
Anil Bishnoi
 

What's hot (20)

Deep C
Deep CDeep C
Deep C
 
Programming fundamental 02
Programming fundamental 02Programming fundamental 02
Programming fundamental 02
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
 
Glimpses of C++0x
Glimpses of C++0xGlimpses of C++0x
Glimpses of C++0x
 
Unit 2 c programming_basics
Unit 2 c programming_basicsUnit 2 c programming_basics
Unit 2 c programming_basics
 
Programming C Part 03
Programming C Part 03Programming C Part 03
Programming C Part 03
 
Introduction to Basic C programming 02
Introduction to Basic C programming 02Introduction to Basic C programming 02
Introduction to Basic C programming 02
 
Object-Oriented Programming in Modern C++. Borislav Stanimirov. CoreHard Spri...
Object-Oriented Programming in Modern C++. Borislav Stanimirov. CoreHard Spri...Object-Oriented Programming in Modern C++. Borislav Stanimirov. CoreHard Spri...
Object-Oriented Programming in Modern C++. Borislav Stanimirov. CoreHard Spri...
 
VTU PCD Model Question Paper - Programming in C
VTU PCD Model Question Paper - Programming in CVTU PCD Model Question Paper - Programming in C
VTU PCD Model Question Paper - Programming in C
 
Control Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, StructuresControl Statements, Array, Pointer, Structures
Control Statements, Array, Pointer, Structures
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Basics of C porgramming
Basics of C porgrammingBasics of C porgramming
Basics of C porgramming
 
Chap 2 input output dti2143
Chap 2  input output dti2143Chap 2  input output dti2143
Chap 2 input output dti2143
 
Overview of c++ language
Overview of c++ language   Overview of c++ language
Overview of c++ language
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
C if else
C if elseC if else
C if else
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manual
 

Viewers also liked

#OOP_D_ITS - 3rd - Pointer And References
#OOP_D_ITS - 3rd - Pointer And References#OOP_D_ITS - 3rd - Pointer And References
#OOP_D_ITS - 3rd - Pointer And ReferencesHadziq Fabroyir
 
#OOP_D_ITS - 8th - Class Diagram
#OOP_D_ITS - 8th - Class Diagram#OOP_D_ITS - 8th - Class Diagram
#OOP_D_ITS - 8th - Class DiagramHadziq Fabroyir
 
10 Curso de POO en java - métodos modificadores y analizadores
10 Curso de POO en java - métodos modificadores y analizadores10 Curso de POO en java - métodos modificadores y analizadores
10 Curso de POO en java - métodos modificadores y analizadores
Clara Patricia Avella Ibañez
 
11 Curso de POO en java - métodos constructores y toString()
11 Curso de POO en java - métodos constructores y toString()11 Curso de POO en java - métodos constructores y toString()
11 Curso de POO en java - métodos constructores y toString()
Clara Patricia Avella Ibañez
 
8b Curso de POO en java - paso de diagrama clases a java 1
8b Curso de POO en java - paso de diagrama clases a java 18b Curso de POO en java - paso de diagrama clases a java 1
8b Curso de POO en java - paso de diagrama clases a java 1
Clara Patricia Avella Ibañez
 

Viewers also liked (6)

#OOP_D_ITS - 3rd - Pointer And References
#OOP_D_ITS - 3rd - Pointer And References#OOP_D_ITS - 3rd - Pointer And References
#OOP_D_ITS - 3rd - Pointer And References
 
#OOP_D_ITS - 8th - Class Diagram
#OOP_D_ITS - 8th - Class Diagram#OOP_D_ITS - 8th - Class Diagram
#OOP_D_ITS - 8th - Class Diagram
 
10 Curso de POO en java - métodos modificadores y analizadores
10 Curso de POO en java - métodos modificadores y analizadores10 Curso de POO en java - métodos modificadores y analizadores
10 Curso de POO en java - métodos modificadores y analizadores
 
18 Curso POO en java - contenedores
18 Curso POO en java - contenedores18 Curso POO en java - contenedores
18 Curso POO en java - contenedores
 
11 Curso de POO en java - métodos constructores y toString()
11 Curso de POO en java - métodos constructores y toString()11 Curso de POO en java - métodos constructores y toString()
11 Curso de POO en java - métodos constructores y toString()
 
8b Curso de POO en java - paso de diagrama clases a java 1
8b Curso de POO en java - paso de diagrama clases a java 18b Curso de POO en java - paso de diagrama clases a java 1
8b Curso de POO en java - paso de diagrama clases a java 1
 

Similar to #OOP_D_ITS - 3rd - Migration From C To C++

M2 (1).pptxisedepofengiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
M2 (1).pptxisedepofengiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiM2 (1).pptxisedepofengiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
M2 (1).pptxisedepofengiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
rakshithatan
 
operators.ppt
operators.pptoperators.ppt
operators.ppt
gamingwithfaulty
 
Programming basics
Programming basicsProgramming basics
Programming basics
246paa
 
CP Handout#4
CP Handout#4CP Handout#4
CP Handout#4
trupti1976
 
presentation_python_11_1569171345_375360.pptx
presentation_python_11_1569171345_375360.pptxpresentation_python_11_1569171345_375360.pptx
presentation_python_11_1569171345_375360.pptx
GAURAVRATHORE86
 
C++ Programming Club-Lecture 2
C++ Programming Club-Lecture 2C++ Programming Club-Lecture 2
C++ Programming Club-Lecture 2Ammara Javed
 
An imperative study of c
An imperative study of cAn imperative study of c
An imperative study of c
Tushar B Kute
 
C Programming
C ProgrammingC Programming
C Programming
Raj vardhan
 
175035 cse lab-05
175035 cse lab-05 175035 cse lab-05
175035 cse lab-05
Mahbubay Rabbani Mim
 
COM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & BranchingCOM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & Branching
Hemantha Kulathilake
 
Statement
StatementStatement
Statement
Ahmad Kamal
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.
Haard Shah
 
Expressions using operator in c
Expressions using operator in cExpressions using operator in c
Expressions using operator in c
Saranya saran
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
GrejoJoby1
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in C
sana shaikh
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures
Pradipta Mishra
 

Similar to #OOP_D_ITS - 3rd - Migration From C To C++ (20)

M2 (1).pptxisedepofengiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
M2 (1).pptxisedepofengiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiM2 (1).pptxisedepofengiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
M2 (1).pptxisedepofengiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
 
operators.ppt
operators.pptoperators.ppt
operators.ppt
 
Elements of programming
Elements of programmingElements of programming
Elements of programming
 
Programming basics
Programming basicsProgramming basics
Programming basics
 
CP Handout#4
CP Handout#4CP Handout#4
CP Handout#4
 
presentation_python_11_1569171345_375360.pptx
presentation_python_11_1569171345_375360.pptxpresentation_python_11_1569171345_375360.pptx
presentation_python_11_1569171345_375360.pptx
 
C++ Programming Club-Lecture 2
C++ Programming Club-Lecture 2C++ Programming Club-Lecture 2
C++ Programming Club-Lecture 2
 
An imperative study of c
An imperative study of cAn imperative study of c
An imperative study of c
 
C Programming
C ProgrammingC Programming
C Programming
 
Control All
Control AllControl All
Control All
 
175035 cse lab-05
175035 cse lab-05 175035 cse lab-05
175035 cse lab-05
 
COM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & BranchingCOM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & Branching
 
Statement
StatementStatement
Statement
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.
 
Expressions using operator in c
Expressions using operator in cExpressions using operator in c
Expressions using operator in c
 
Ch4
Ch4Ch4
Ch4
 
ICP - Lecture 7 and 8
ICP - Lecture 7 and 8ICP - Lecture 7 and 8
ICP - Lecture 7 and 8
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in C
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures
 

More from Hadziq Fabroyir

An Immersive Map Exploration System Using Handheld Device
An Immersive Map Exploration System Using Handheld DeviceAn Immersive Map Exploration System Using Handheld Device
An Immersive Map Exploration System Using Handheld Device
Hadziq Fabroyir
 
在不同尺度遙現系統中具空間感知特性的使用者介面開發
在不同尺度遙現系統中具空間感知特性的使用者介面開發在不同尺度遙現系統中具空間感知特性的使用者介面開發
在不同尺度遙現系統中具空間感知特性的使用者介面開發
Hadziq Fabroyir
 
NTUST Course Selection (Revision: Fall 2016)
NTUST Course Selection (Revision: Fall 2016)NTUST Course Selection (Revision: Fall 2016)
NTUST Course Selection (Revision: Fall 2016)
Hadziq Fabroyir
 
律法保護的五件事
律法保護的五件事律法保護的五件事
律法保護的五件事
Hadziq Fabroyir
 
Pelajaran 5 第五課 • Telepon 給打電話
Pelajaran 5 第五課 • Telepon 給打電話Pelajaran 5 第五課 • Telepon 給打電話
Pelajaran 5 第五課 • Telepon 給打電話
Hadziq Fabroyir
 
Pelajaran 4 第四課 • Belanja 買東西
Pelajaran 4 第四課 • Belanja 買東西Pelajaran 4 第四課 • Belanja 買東西
Pelajaran 4 第四課 • Belanja 買東西
Hadziq Fabroyir
 
Pelajaran 3 第三課 • Transportasi 交通
Pelajaran 3 第三課 • Transportasi 交通Pelajaran 3 第三課 • Transportasi 交通
Pelajaran 3 第三課 • Transportasi 交通
Hadziq Fabroyir
 
Pelajaran 2 第二課 • Di Restoran 在餐廳
Pelajaran 2 第二課 • Di Restoran 在餐廳Pelajaran 2 第二課 • Di Restoran 在餐廳
Pelajaran 2 第二課 • Di Restoran 在餐廳
Hadziq Fabroyir
 
Pelajaran 1 第一課 • Perkenalan Diri 自我介紹
Pelajaran 1 第一課 • Perkenalan Diri 自我介紹Pelajaran 1 第一課 • Perkenalan Diri 自我介紹
Pelajaran 1 第一課 • Perkenalan Diri 自我介紹
Hadziq Fabroyir
 
Living in Taiwan for Dummies
Living in Taiwan for DummiesLiving in Taiwan for Dummies
Living in Taiwan for DummiesHadziq Fabroyir
 
How to Select Course at NTUST
How to Select Course at NTUSTHow to Select Course at NTUST
How to Select Course at NTUST
Hadziq Fabroyir
 
NTUST-IMSA • International Students Orientation
NTUST-IMSA • International Students OrientationNTUST-IMSA • International Students Orientation
NTUST-IMSA • International Students Orientation
Hadziq Fabroyir
 
NTUST Course Selection - How to
NTUST Course Selection - How toNTUST Course Selection - How to
NTUST Course Selection - How toHadziq Fabroyir
 
Brain Battle Online
Brain Battle OnlineBrain Battle Online
Brain Battle Online
Hadziq Fabroyir
 
Manajemen Waktu
Manajemen WaktuManajemen Waktu
Manajemen Waktu
Hadziq Fabroyir
 
#OOP_D_ITS - 9th - Template
#OOP_D_ITS - 9th - Template#OOP_D_ITS - 9th - Template
#OOP_D_ITS - 9th - TemplateHadziq Fabroyir
 
#OOP_D_ITS - 6th - C++ Oop Inheritance
#OOP_D_ITS - 6th - C++ Oop Inheritance#OOP_D_ITS - 6th - C++ Oop Inheritance
#OOP_D_ITS - 6th - C++ Oop InheritanceHadziq Fabroyir
 
#OOP_D_ITS - 5th - C++ Oop Operator Overloading
#OOP_D_ITS - 5th - C++ Oop Operator Overloading#OOP_D_ITS - 5th - C++ Oop Operator Overloading
#OOP_D_ITS - 5th - C++ Oop Operator OverloadingHadziq Fabroyir
 
#OOP_D_ITS - 2nd - C++ Getting Started
#OOP_D_ITS - 2nd - C++ Getting Started#OOP_D_ITS - 2nd - C++ Getting Started
#OOP_D_ITS - 2nd - C++ Getting StartedHadziq Fabroyir
 
#OOP_D_ITS - 4th - C++ Oop And Class Structure
#OOP_D_ITS - 4th - C++ Oop And Class Structure#OOP_D_ITS - 4th - C++ Oop And Class Structure
#OOP_D_ITS - 4th - C++ Oop And Class StructureHadziq Fabroyir
 

More from Hadziq Fabroyir (20)

An Immersive Map Exploration System Using Handheld Device
An Immersive Map Exploration System Using Handheld DeviceAn Immersive Map Exploration System Using Handheld Device
An Immersive Map Exploration System Using Handheld Device
 
在不同尺度遙現系統中具空間感知特性的使用者介面開發
在不同尺度遙現系統中具空間感知特性的使用者介面開發在不同尺度遙現系統中具空間感知特性的使用者介面開發
在不同尺度遙現系統中具空間感知特性的使用者介面開發
 
NTUST Course Selection (Revision: Fall 2016)
NTUST Course Selection (Revision: Fall 2016)NTUST Course Selection (Revision: Fall 2016)
NTUST Course Selection (Revision: Fall 2016)
 
律法保護的五件事
律法保護的五件事律法保護的五件事
律法保護的五件事
 
Pelajaran 5 第五課 • Telepon 給打電話
Pelajaran 5 第五課 • Telepon 給打電話Pelajaran 5 第五課 • Telepon 給打電話
Pelajaran 5 第五課 • Telepon 給打電話
 
Pelajaran 4 第四課 • Belanja 買東西
Pelajaran 4 第四課 • Belanja 買東西Pelajaran 4 第四課 • Belanja 買東西
Pelajaran 4 第四課 • Belanja 買東西
 
Pelajaran 3 第三課 • Transportasi 交通
Pelajaran 3 第三課 • Transportasi 交通Pelajaran 3 第三課 • Transportasi 交通
Pelajaran 3 第三課 • Transportasi 交通
 
Pelajaran 2 第二課 • Di Restoran 在餐廳
Pelajaran 2 第二課 • Di Restoran 在餐廳Pelajaran 2 第二課 • Di Restoran 在餐廳
Pelajaran 2 第二課 • Di Restoran 在餐廳
 
Pelajaran 1 第一課 • Perkenalan Diri 自我介紹
Pelajaran 1 第一課 • Perkenalan Diri 自我介紹Pelajaran 1 第一課 • Perkenalan Diri 自我介紹
Pelajaran 1 第一課 • Perkenalan Diri 自我介紹
 
Living in Taiwan for Dummies
Living in Taiwan for DummiesLiving in Taiwan for Dummies
Living in Taiwan for Dummies
 
How to Select Course at NTUST
How to Select Course at NTUSTHow to Select Course at NTUST
How to Select Course at NTUST
 
NTUST-IMSA • International Students Orientation
NTUST-IMSA • International Students OrientationNTUST-IMSA • International Students Orientation
NTUST-IMSA • International Students Orientation
 
NTUST Course Selection - How to
NTUST Course Selection - How toNTUST Course Selection - How to
NTUST Course Selection - How to
 
Brain Battle Online
Brain Battle OnlineBrain Battle Online
Brain Battle Online
 
Manajemen Waktu
Manajemen WaktuManajemen Waktu
Manajemen Waktu
 
#OOP_D_ITS - 9th - Template
#OOP_D_ITS - 9th - Template#OOP_D_ITS - 9th - Template
#OOP_D_ITS - 9th - Template
 
#OOP_D_ITS - 6th - C++ Oop Inheritance
#OOP_D_ITS - 6th - C++ Oop Inheritance#OOP_D_ITS - 6th - C++ Oop Inheritance
#OOP_D_ITS - 6th - C++ Oop Inheritance
 
#OOP_D_ITS - 5th - C++ Oop Operator Overloading
#OOP_D_ITS - 5th - C++ Oop Operator Overloading#OOP_D_ITS - 5th - C++ Oop Operator Overloading
#OOP_D_ITS - 5th - C++ Oop Operator Overloading
 
#OOP_D_ITS - 2nd - C++ Getting Started
#OOP_D_ITS - 2nd - C++ Getting Started#OOP_D_ITS - 2nd - C++ Getting Started
#OOP_D_ITS - 2nd - C++ Getting Started
 
#OOP_D_ITS - 4th - C++ Oop And Class Structure
#OOP_D_ITS - 4th - C++ Oop And Class Structure#OOP_D_ITS - 4th - C++ Oop And Class Structure
#OOP_D_ITS - 4th - C++ Oop And Class Structure
 

Recently uploaded

Prix Galien International 2024 Forum Program
Prix Galien International 2024 Forum ProgramPrix Galien International 2024 Forum Program
Prix Galien International 2024 Forum Program
Levi Shapiro
 
Maxilla, Mandible & Hyoid Bone & Clinical Correlations by Dr. RIG.pptx
Maxilla, Mandible & Hyoid Bone & Clinical Correlations by Dr. RIG.pptxMaxilla, Mandible & Hyoid Bone & Clinical Correlations by Dr. RIG.pptx
Maxilla, Mandible & Hyoid Bone & Clinical Correlations by Dr. RIG.pptx
Dr. Rabia Inam Gandapore
 
Physiology of Chemical Sensation of smell.pdf
Physiology of Chemical Sensation of smell.pdfPhysiology of Chemical Sensation of smell.pdf
Physiology of Chemical Sensation of smell.pdf
MedicoseAcademics
 
Alcohol_Dr. Jeenal Mistry MD Pharmacology.pdf
Alcohol_Dr. Jeenal Mistry MD Pharmacology.pdfAlcohol_Dr. Jeenal Mistry MD Pharmacology.pdf
Alcohol_Dr. Jeenal Mistry MD Pharmacology.pdf
Dr Jeenal Mistry
 
Physiology of Special Chemical Sensation of Taste
Physiology of Special Chemical Sensation of TastePhysiology of Special Chemical Sensation of Taste
Physiology of Special Chemical Sensation of Taste
MedicoseAcademics
 
BENIGN PROSTATIC HYPERPLASIA.BPH. BPHpdf
BENIGN PROSTATIC HYPERPLASIA.BPH. BPHpdfBENIGN PROSTATIC HYPERPLASIA.BPH. BPHpdf
BENIGN PROSTATIC HYPERPLASIA.BPH. BPHpdf
DR SETH JOTHAM
 
Ophthalmology Clinical Tests for OSCE exam
Ophthalmology Clinical Tests for OSCE examOphthalmology Clinical Tests for OSCE exam
Ophthalmology Clinical Tests for OSCE exam
KafrELShiekh University
 
Flu Vaccine Alert in Bangalore Karnataka
Flu Vaccine Alert in Bangalore KarnatakaFlu Vaccine Alert in Bangalore Karnataka
Flu Vaccine Alert in Bangalore Karnataka
addon Scans
 
Report Back from SGO 2024: What’s the Latest in Cervical Cancer?
Report Back from SGO 2024: What’s the Latest in Cervical Cancer?Report Back from SGO 2024: What’s the Latest in Cervical Cancer?
Report Back from SGO 2024: What’s the Latest in Cervical Cancer?
bkling
 
Couples presenting to the infertility clinic- Do they really have infertility...
Couples presenting to the infertility clinic- Do they really have infertility...Couples presenting to the infertility clinic- Do they really have infertility...
Couples presenting to the infertility clinic- Do they really have infertility...
Sujoy Dasgupta
 
ARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTS
ARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTSARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTS
ARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTS
Dr. Vinay Pareek
 
BRACHYTHERAPY OVERVIEW AND APPLICATORS
BRACHYTHERAPY OVERVIEW  AND  APPLICATORSBRACHYTHERAPY OVERVIEW  AND  APPLICATORS
BRACHYTHERAPY OVERVIEW AND APPLICATORS
Krishan Murari
 
Tom Selleck Health: A Comprehensive Look at the Iconic Actor’s Wellness Journey
Tom Selleck Health: A Comprehensive Look at the Iconic Actor’s Wellness JourneyTom Selleck Health: A Comprehensive Look at the Iconic Actor’s Wellness Journey
Tom Selleck Health: A Comprehensive Look at the Iconic Actor’s Wellness Journey
greendigital
 
basicmodesofventilation2022-220313203758.pdf
basicmodesofventilation2022-220313203758.pdfbasicmodesofventilation2022-220313203758.pdf
basicmodesofventilation2022-220313203758.pdf
aljamhori teaching hospital
 
ANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptxANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptx
Swetaba Besh
 
The Normal Electrocardiogram - Part I of II
The Normal Electrocardiogram - Part I of IIThe Normal Electrocardiogram - Part I of II
The Normal Electrocardiogram - Part I of II
MedicoseAcademics
 
Are There Any Natural Remedies To Treat Syphilis.pdf
Are There Any Natural Remedies To Treat Syphilis.pdfAre There Any Natural Remedies To Treat Syphilis.pdf
Are There Any Natural Remedies To Treat Syphilis.pdf
Little Cross Family Clinic
 
Pulmonary Thromboembolism - etilogy, types, medical- Surgical and nursing man...
Pulmonary Thromboembolism - etilogy, types, medical- Surgical and nursing man...Pulmonary Thromboembolism - etilogy, types, medical- Surgical and nursing man...
Pulmonary Thromboembolism - etilogy, types, medical- Surgical and nursing man...
VarunMahajani
 
Surgical Site Infections, pathophysiology, and prevention.pptx
Surgical Site Infections, pathophysiology, and prevention.pptxSurgical Site Infections, pathophysiology, and prevention.pptx
Surgical Site Infections, pathophysiology, and prevention.pptx
jval Landero
 
Surat @ℂall @Girls ꧁❤8527049040❤꧂@ℂall @Girls Service Vip Top Model Safe
Surat @ℂall @Girls ꧁❤8527049040❤꧂@ℂall @Girls Service Vip Top Model SafeSurat @ℂall @Girls ꧁❤8527049040❤꧂@ℂall @Girls Service Vip Top Model Safe
Surat @ℂall @Girls ꧁❤8527049040❤꧂@ℂall @Girls Service Vip Top Model Safe
Savita Shen $i11
 

Recently uploaded (20)

Prix Galien International 2024 Forum Program
Prix Galien International 2024 Forum ProgramPrix Galien International 2024 Forum Program
Prix Galien International 2024 Forum Program
 
Maxilla, Mandible & Hyoid Bone & Clinical Correlations by Dr. RIG.pptx
Maxilla, Mandible & Hyoid Bone & Clinical Correlations by Dr. RIG.pptxMaxilla, Mandible & Hyoid Bone & Clinical Correlations by Dr. RIG.pptx
Maxilla, Mandible & Hyoid Bone & Clinical Correlations by Dr. RIG.pptx
 
Physiology of Chemical Sensation of smell.pdf
Physiology of Chemical Sensation of smell.pdfPhysiology of Chemical Sensation of smell.pdf
Physiology of Chemical Sensation of smell.pdf
 
Alcohol_Dr. Jeenal Mistry MD Pharmacology.pdf
Alcohol_Dr. Jeenal Mistry MD Pharmacology.pdfAlcohol_Dr. Jeenal Mistry MD Pharmacology.pdf
Alcohol_Dr. Jeenal Mistry MD Pharmacology.pdf
 
Physiology of Special Chemical Sensation of Taste
Physiology of Special Chemical Sensation of TastePhysiology of Special Chemical Sensation of Taste
Physiology of Special Chemical Sensation of Taste
 
BENIGN PROSTATIC HYPERPLASIA.BPH. BPHpdf
BENIGN PROSTATIC HYPERPLASIA.BPH. BPHpdfBENIGN PROSTATIC HYPERPLASIA.BPH. BPHpdf
BENIGN PROSTATIC HYPERPLASIA.BPH. BPHpdf
 
Ophthalmology Clinical Tests for OSCE exam
Ophthalmology Clinical Tests for OSCE examOphthalmology Clinical Tests for OSCE exam
Ophthalmology Clinical Tests for OSCE exam
 
Flu Vaccine Alert in Bangalore Karnataka
Flu Vaccine Alert in Bangalore KarnatakaFlu Vaccine Alert in Bangalore Karnataka
Flu Vaccine Alert in Bangalore Karnataka
 
Report Back from SGO 2024: What’s the Latest in Cervical Cancer?
Report Back from SGO 2024: What’s the Latest in Cervical Cancer?Report Back from SGO 2024: What’s the Latest in Cervical Cancer?
Report Back from SGO 2024: What’s the Latest in Cervical Cancer?
 
Couples presenting to the infertility clinic- Do they really have infertility...
Couples presenting to the infertility clinic- Do they really have infertility...Couples presenting to the infertility clinic- Do they really have infertility...
Couples presenting to the infertility clinic- Do they really have infertility...
 
ARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTS
ARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTSARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTS
ARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTS
 
BRACHYTHERAPY OVERVIEW AND APPLICATORS
BRACHYTHERAPY OVERVIEW  AND  APPLICATORSBRACHYTHERAPY OVERVIEW  AND  APPLICATORS
BRACHYTHERAPY OVERVIEW AND APPLICATORS
 
Tom Selleck Health: A Comprehensive Look at the Iconic Actor’s Wellness Journey
Tom Selleck Health: A Comprehensive Look at the Iconic Actor’s Wellness JourneyTom Selleck Health: A Comprehensive Look at the Iconic Actor’s Wellness Journey
Tom Selleck Health: A Comprehensive Look at the Iconic Actor’s Wellness Journey
 
basicmodesofventilation2022-220313203758.pdf
basicmodesofventilation2022-220313203758.pdfbasicmodesofventilation2022-220313203758.pdf
basicmodesofventilation2022-220313203758.pdf
 
ANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptxANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptx
 
The Normal Electrocardiogram - Part I of II
The Normal Electrocardiogram - Part I of IIThe Normal Electrocardiogram - Part I of II
The Normal Electrocardiogram - Part I of II
 
Are There Any Natural Remedies To Treat Syphilis.pdf
Are There Any Natural Remedies To Treat Syphilis.pdfAre There Any Natural Remedies To Treat Syphilis.pdf
Are There Any Natural Remedies To Treat Syphilis.pdf
 
Pulmonary Thromboembolism - etilogy, types, medical- Surgical and nursing man...
Pulmonary Thromboembolism - etilogy, types, medical- Surgical and nursing man...Pulmonary Thromboembolism - etilogy, types, medical- Surgical and nursing man...
Pulmonary Thromboembolism - etilogy, types, medical- Surgical and nursing man...
 
Surgical Site Infections, pathophysiology, and prevention.pptx
Surgical Site Infections, pathophysiology, and prevention.pptxSurgical Site Infections, pathophysiology, and prevention.pptx
Surgical Site Infections, pathophysiology, and prevention.pptx
 
Surat @ℂall @Girls ꧁❤8527049040❤꧂@ℂall @Girls Service Vip Top Model Safe
Surat @ℂall @Girls ꧁❤8527049040❤꧂@ℂall @Girls Service Vip Top Model SafeSurat @ℂall @Girls ꧁❤8527049040❤꧂@ℂall @Girls Service Vip Top Model Safe
Surat @ℂall @Girls ꧁❤8527049040❤꧂@ℂall @Girls Service Vip Top Model Safe
 

#OOP_D_ITS - 3rd - Migration From C To C++

  • 1. Migration: C to C++ 09/09/2009 1 Hadziq Fabroyir - Informatics ITS
  • 2. C/C++ Program Structure Operating System void function1() { //... return; } int main() { function1(); function2(); function3(); return 0; } void function2() { //... return; } void function3() { //... return; } Operating System
  • 3. Naming Variable MUST Identifier / variable name can include letters(A-z), digits(0-9), and underscore(_) Identifier starts with letteror underscore Do NOT use keywordsas identifier Identifier in C++ is case-sensitive CONSIDER Usemeaningfullname Limit identifier length up to 31 characters, although it can have length up to 2048 Avoid using identifiers that start with an underscore 09/09/2009 Hadziq Fabroyir - Informatics ITS 3
  • 4. Keywords 09/09/2009 Hadziq Fabroyir - Informatics ITS 4
  • 5. Declaring Variable 09/09/2009 Hadziq Fabroyir - Informatics ITS 5 int value; char[] firstName; Char[] address; int 9ball; long bigInt; System::String full_name; int count!; long class; float a234_djJ_685_abc___;
  • 6. Initializing Variable int value = 0; char[] firstName = “Budi”; long bigInt(100L); System::String^ full_name = “Budi Lagi”; 09/09/2009 Hadziq Fabroyir - Informatics ITS 6
  • 7. Fundamental Data Types 09/09/2009 Hadziq Fabroyir - Informatics ITS 7
  • 8. Literals 09/09/2009 Hadziq Fabroyir - Informatics ITS 8
  • 9. Example of Data Types int main() { char c = 'A'; wchar_t wideChar = L'9'; int i = 123; long l = 10240L; float f = 3.14f; double d = 3.14; bool b = true; return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 9
  • 10. Enumerations Variable with specific sets of values Enum Day {Mon, Tues, Wed, Thurs, Fri, Sat, Sun}; Day today = Mon; Enum Day {Mon = 1, Tues, Wed, Thurs, Fri, Sat, Sun}; Day nextDay = Tues; 09/09/2009 Hadziq Fabroyir - Informatics ITS 10
  • 11. Basic Input/Output Operations int main() { //declare and initialize variables int num1 = 0; int num2 = 0; //getting input from keyboard cin >> num1 >> num2; //output the variables value to command line cout << endl; cout << "Num1 : " << num1 << endl; cout << "Num2 : " << num2; return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 11
  • 12. Escape Sequence 09/09/2009 Hadziq Fabroyir - Informatics ITS 12
  • 13. Basic Operators int main() { int a = 0; int b = 0; int c = 0; c = a + b; c = a - b; c = a * b; c = a / b; c = a % b; a = -b; return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 13
  • 14. Bitwise Operators 09/09/2009 Hadziq Fabroyir - Informatics ITS 14 & bitwise AND ~ bitwise NOT | bitwise OR ^ bitwise XOR >>shift right <<shift left
  • 15. Increment and Decrement Operators int main() { int a = 0; int b = 0; a++; b--; ++a; ++b; return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 15
  • 16. Shorthand Operators int main() { int a = 0; int b = 0; a += 3; b -= a; a *= 2; b /= 32; a %= b; return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 16
  • 17. Explicit Casting static_cast<the_type_to_convert_to>(expression) (the_type_to_convert_to)expression 09/09/2009 Hadziq Fabroyir - Informatics ITS 17
  • 18. Constant Declaration int main() { const double rollwidth = 21.0; const double rolllength = 12.0*33.0; const double rollarea = rollwidth*rolllength; return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 18
  • 19. Declaring Namespace namespace MyNamespace { // code belongs to myNamespace } namespace OtherNamespace { // code belongs to otherNamespace } 09/09/2009 Hadziq Fabroyir - Informatics ITS 19
  • 20. Using Namespace #include <iostream> namespace myStuff { int value = 0; } int main() { std::cout << “enter an integer: “; std::cin >> myStuff::value; std::cout << “You entered “ << myStuff::value << std:: endl; return 0; } #include <iostream> namespace myStuff { int value = 0; } using namespace myStuff; int main() { std::cout << “enter an integer: “; std::cin >> value; std::cout << “You entered “ << value<< std:: endl; return 0; } 09/09/2009 Hadziq Fabroyir - Informatics ITS 20
  • 21. Visual C++ Programming Environment Hadziq Fabroyir - Informatics ITS ISO/ANSI C++ (unmanaged) C++/CLI .NET Framework Managed C++ Native C++ Framework Classes Native C++ MFC Common Language Runtime (CLR) Operating System HHardware 09/09/2009 21
  • 22. C++/CLI Data Types 09/09/2009 Hadziq Fabroyir - Informatics ITS 22
  • 23. ITC1398 Introduction to Programming Chapter 3 23 Control Structures Three control structures Sequence structure Programs executed sequentially by default Selection structures if, if…else, switch Repetition structures while, do…while, for
  • 24. ITC1398 Introduction to Programming Chapter 3 24 if Selection Statement Choose among alternative courses of action Pseudocode example If student’s grade is greater than or equal to 60 print “Passed” If the condition is true Print statement executes, program continues to next statement If the condition is false Print statement ignored, program continues
  • 25. Activity Diagram 09/09/2009 Hadziq Fabroyir - Informatics ITS 25
  • 26. ITC1398 Introduction to Programming Chapter 3 26 if Selection Statement Translation into C++ if ( grade >= 60 ) cout << "Passed"; Any expression can be used as the condition If it evaluates to zero, it is treated as false If it evaluates to non-zero, it is treated as true
  • 27. ITC1398 Introduction to Programming Chapter 3 27 if…else Double-Selection Statement if Performs action if condition true if…else Performs one action if condition is true, a different action if it is false Pseudocode If student’s grade is greater than or equal to 60 print “Passed”Else print “Failed” C++ code if ( grade >= 60 ) cout << "Passed";else cout << "Failed";
  • 28. Activity Diagram 09/09/2009 Hadziq Fabroyir - Informatics ITS 28
  • 29. ITC1398 Introduction to Programming Chapter 3 29 if…else Double-Selection Statement Ternary conditional operator (?:) Three arguments (condition, value if true, value if false) Code could be written: cout << ( grade >= 60 ? “Passed” : “Failed” ); Condition Value if true Value if false
  • 30. ITC1398 Introduction to Programming Chapter 3 30 if…else Double-Selection Statement Nested if…else statements One inside another, test for multiple cases Once a condition met, other statements are skipped Example If student’s grade is greater than or equal to 90 Print “A” Else If student’s grade is greater than or equal to 80 Print “B” Else If student’s grade is greater than or equal to 70 Print “C” Else If student’s grade is greater than or equal to 60 Print “D” Else Print “F”
  • 31. ITC1398 Introduction to Programming Chapter 3 31 if…else Double-Selection Statement Nested if…else statements (Cont.) Written In C++ if ( studentGrade >= 90 ) cout << "A";elseif (studentGrade >= 80 ) cout << "B";elseif (studentGrade >= 70 ) cout << "C"; elseif ( studentGrade >= 60 ) cout << "D";else cout << "F";
  • 32. while Repetition Statement A repetition statement (also called a looping statement or a loop) allows the programmer to specify that a program should repeat an action while some condition remains true. The pseudocode statement While there are more items on my shopping list Purchase next item and cross it off my list 09/09/2009 Hadziq Fabroyir - Informatics ITS 32
  • 33. for Repetition Statement 09/09/2009 Hadziq Fabroyir - Informatics ITS 33
  • 34. do …while Repetition Statement do { statement } while ( condition ); 09/09/2009 Hadziq Fabroyir - Informatics ITS 34
  • 35. switch Multiple-Selection Statement 09/09/2009 Hadziq Fabroyir - Informatics ITS 35
  • 36. For your practice … Lab Session I (Ahad, 19.00-21.00) 4.14 5.20 6.27 Lab Session II (Senin, 19.00-21.00) 4.35 5.12 6.30 09/09/2009 Hadziq Fabroyir - Informatics ITS 36
  • 37. ☺~ Next: OOP using C++ ~☺ [ 37 ] Hadziq Fabroyir - Informatics ITS 09/09/2009