1 introduction from bina nusantara university
DESCRIPTION
introduction OOPsemoga bisa membantu waktu pertama kali dan untuk mengenal lebih dalam lagi apa itu oopTRANSCRIPT
![Page 1: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/1.jpg)
COMP6175 – Object Oriented ProgrammingTopic 1 - Introduction
![Page 2: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/2.jpg)
OUTLINE MATERIALS
• Programming Paradigms• Unstructured Programming• Structured Programming• Object – Oriented Programming• Object – Oriented Programming Languages• Why C++• C++ Example
Topic 1 – Introduction
![Page 3: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/3.jpg)
Topic 1 - Introduction
![Page 4: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/4.jpg)
Programming Paradigms• Programming paradigm is a way of
conceptualizing what it means to perform computation and how tasks to be carried out on the computer should be structured and organized.
• Paradigms are the way that we think about problems and how to solve the problems by considering :– the nature of problems– how they are to be approached
![Page 5: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/5.jpg)
Programming Paradigms (2)• Programming paradigm also refers to the
approach used to develop a program for solving problems.
• Broadly, programming can be classified into three categories:– Unstructured Programming– Structured Programming– Object-oriented Programming
![Page 6: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/6.jpg)
Unstructured Programming• Unstructured Programming refers to writing
simple and small programs which consist of only one main program, and all the actions of input, process and output are done within a program.
• goto Statement• Multi Entry and Multi Exit Subprogram• Spaghetti Code
![Page 7: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/7.jpg)
Structured Programming• goto less Programming• Structured Theory
– Sequential – Selection– Iteration
• Single Entry and Single Exit Subprogram• Using structured programming, a program is
broken down into small independent tasks that are small enough to be understood easily, where each task has its own functionality and performs a specific part of the actual processing
![Page 8: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/8.jpg)
Structured Programming (2)• Structured Programming can be performed in
two ways:– Procedural Programming– Modular Programming
![Page 9: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/9.jpg)
Structured Programming (3)• Procedural Programming
– This programming has a single program that is divided into small segments, called as procedures (also known as functions, routines, subroutines or methods).
• Modular Programming– The programs coded with procedural usually fits in a
single code file and it is for relatively small program– If the program gets large, modular programming is
recommended– Modular programming is where large programs is broken
down into some smaller program units known as modules– Each module is designed to perform specific functions
![Page 10: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/10.jpg)
Object-Oriented Programming• Object-oriented programming (OOP), is a programming
paradigm that represent concepts as “objects” where each objects will have “data fields” and “methods”
• Data fields or also known as data members or attributes are used to describe the object while methods are used to describe the interactions between object.
• In OOP, an object is an instance of a “class”.
• More about OOP will be discussed in next session
![Page 11: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/11.jpg)
Object-Oriented Programming• Object-oriented programming (OOP), is a programming
paradigm that represent concepts as “objects” where each objects will have “data fields” and “methods”
• Data fields or also known as data members or attributes are used to describe the object while methods are used to describe the interactions between object.
• In OOP, an object is an instance of a “class”.
• More about OOP will be discussed in next session
![Page 12: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/12.jpg)
Structured Programming VS OOP• Structured Programming
– Focuses on process– Top Down approach– A Single module will be split into several smaller modules– General to Specific– If the requirements are clear at the first instance we can go
for Top down approach• OOP
– Focuses on object– Bottom Up approach– Lot of small modules will be grouped to form a single large
module– Specific to General– In circumstances where the requirements may keep on
adding, we go for Bottom up approach
![Page 13: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/13.jpg)
OO Programming Languages• There are many programming languages which
support OOP, some of them are:– C++– Java– C#
![Page 14: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/14.jpg)
C++ Philosophy• C++
– General-purpose language, as efficient and portable as C
– support multiple programming styles ( procedural programming, data abstraction, o-o programming, and generic programming )
– providing a smooth transition from C– avoids features that are platform specific or
not general purpose
![Page 15: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/15.jpg)
Java• Compared to C++:
– no header files, – no macros, – no pointers and references, – no unions, – no operator overloading, – no templates
• Object-orientation: – Classes– Inheritance– Doesn’t support multiple inheritance use interface
![Page 16: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/16.jpg)
Java (2)• Robust:
– Strong typing – no pointer– garbage collection
• Secure: – access control
• Portable– Runs in many OS, such as Windows, Linux, iOS
• Multi-threaded
![Page 17: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/17.jpg)
C#• C# : pronounced C Sharp• It is a multi-paradigm language that include
functional, imperative, OO and component-oriented disciplines
• C# is intended to be a programming language that is :– simple, – modern, – general-purpose, – Object-oriented
• It was initially named Cool, which stood for "C-like Object Oriented Language."
• However, in July 2000, the name of the programming language was given as C#.
![Page 18: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/18.jpg)
Why C++ ?• C++ is a general-purpose
programming language with a bias towards systems programming that– is a better C– expressive– supports object-oriented programming – supports generic programming
• containers: stack of char, int, double etc• generic algorithms: sort(), copy(), search()
any container Stack/Vector/List
![Page 19: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/19.jpg)
C++ Example
include <iostream>
using namespace std;
int main(){cout<<"Welcome to C++ Programming";cin.get();return 0;
}
My First Program in C++
![Page 20: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/20.jpg)
Q & A
![Page 21: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/21.jpg)
References• Deitel, P., & Deitel, H. (2012). C++ How to Program.8th
edition. New Jersey: Prentice Hall. Chapter 1 & 2• ITL Education Solutions Limited. (2011). Introduction
to Computer Science. 2nd edition. Pearson Education. ISBN: 9788131760307 . Chapter 8
![Page 22: 1 Introduction from bina nusantara university](https://reader031.vdocument.in/reader031/viewer/2022020505/55cf8d125503462b1391d9c8/html5/thumbnails/22.jpg)
THANK YOU