SlideShare une entreprise Scribd logo
1  sur  27
제  2  장 자료설계와 구현
Data Abstraction ( 자료 추상화 )  ,[object Object],LOGICAL PROPERTIES IMPLEMENTATION What are the possible values? How can this be done in C++? - domain What operations will be  needed?   How can data types be used?
Data Encapsulation ( 자료 캡슐화 )   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],int  y; y = 25; APPLICATION 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 REPRESENTATION
Encapsulated C++ Data Type int Value range:  INT_MIN . . INT_MAX Operations: +  prefix -  prefix +  infix -  infix *  infix /  infix %  infix Relational Operators infix TYPE int   (inside) Representation of int as 16 bits two’s  complement + Implementation of  Operations
Abstract Data Type (ADT)  ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],Data from 3 different levels   WHAT HOW
추상 데이타 타입과  C++  클래스 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
C++ 에서의 데이타 추상화와 캡슐화 (1) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Use of C++ data type class ,[object Object],[object Object],[object Object],[object Object]
C++ 에서의 데이타 추상화와 캡슐화 (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Information Hiding ,[object Object],[object Object],client code specification implementation abstraction barrier
클래스 객체의 선언과 멤버 함수의 기동 ,[object Object],[object Object],[object Object],[object Object],//  소스화일  main.cpp  속에 #include <iostream>  #include &quot;Rectangle.h&quot; main() { Rectangle   r ,  s ;    //  r 과  s 는  Class  Rectangle 의 객체들이다 . Rectangle   *t = &s ;    //  t 는 클래스 객체  s 에 대한 포인터이다 . . . //  클래스 객체의 멤버를 접근하기 위해서는 점 (.) 을 사용한다 . //  포인터를 통해 클래스 객체의 멤버를 접근하기 위해서는   를 사용한다 . if  ( r.GetHeight ()* r.GetWidth ()  >  t  GetHeight () *  t  GetWidth ())   cout   <<  &quot; r &quot;; else cout   <<  &quot; s &quot;; cout <<  &quot;has the greater area&quot;  <<   endl ; } 어떻게  Rectangle  객체가 선언되고 멤버 함수가 기동되는가를 예시하는  C++ 코드 부분
생성자 ( constructor ) 와 파괴자 ( destructor ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Rectangle :: Rectangle ( int   x ,  int   y ,  int   h ,  int   w ) { xLow  =  x ;  yLow  =  y ; height  =  h ;  width  =  w ; } Rectangle   클래스의 생성자 정의
생성자 ( constructor ) 와 파괴자 ( destructor ) ,[object Object],[object Object],[object Object],[object Object],Rectangle   r (1,3,6,6); Rectangle  * s  =  new   Rectangle (0,0,3,4); Rectangle   t ;  //  컴파일 시간 오류 !     생성자 필요 Rectangle :: Rectangle  ( int   x  = 0,  int   y  = 0,   int   h  = 0,  int  w  = 0 ) :  xLow ( x ),  yLow ( y ),  height ( h ),  width ( w ) { }
생성자 (constructor) 와 소멸자 (destructor) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
연산자 다중화 (operator overloading) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
연산자 다중화 (operator overloading) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],bool   Rectangle :: operator ==( const   Rectangle  &  s  ){ if  ( this  == & s )  return true ; if  (( xLow  ==  s.xLow ) && ( yLow  ==  s.yLow )  && ( height  ==  s.height ) && ( width == s.width )  return true ;  else return false ;  }
연산자 다중화 (operator overloading) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],ostream &  operator   << ( ostream &  os ,  Rectangle &  r ) { os  <<  &quot;Position is: “  <<  r.xLow   <<  &quot; &quot;; os   <<   r.yLow  <  endl ; os   <<  &quot;Height is: “  <<  r.height   << endl ; os   <<  &quot;Width is: &quot;r.width  << endl ; return   os ; }
기타 내용 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ADT 와  C++  클래스 ,[object Object],[object Object],[object Object],[object Object]
추상 데이타 타입으로서의 배열 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
다항식 추상 데이타 타입 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
순서 리스트 ,  선형 리스트 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
배열의 표현 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],a[u 1 ] 의 순차적인 표현 배열 원소 a[0] a[1] ... a[i] ... a[u 1 -1] 주소   +1 ...  +i ...  +u 1 -1
배열의 표현 ,[object Object],[object Object],[object Object],[object Object],x  x  …  x x  x  …  x x  x  …  x x  x  …  x col0 col1 col u 2 -l row 0 row 1 row u 1  -1 (a) u 2 element u 2 element row 0 row 1 ... ... row  i i*u 2  element (b) a[u 1 ][u 2 ] 의 순차적 표현 row u i -1 row 2
배열의 표현 ,[object Object],[object Object],[object Object],[object Object],u 2 u 3 u 1 (a) 3 차원 배열  A[u 1 ][u 2 ][u 3 ]  가  u 1 개의  2 차원 배열로 취급됨
다차원 배열의 표현 ,[object Object],[object Object],[object Object],[object Object],[object Object],i u 2 u 3  elements A(0,u 2 ,u 3 ) A(1,u 2 ,u 3 ) ... A(u 1 -1,u 2 ,u 3 ) (b) 3 차원 배열의 순차 행 우선 표현 여기서   A(1,u 2 ,u 3 ) ... 1 1 , 1        n n j k k j a n j u a

Contenu connexe

Tendances

파이썬+주요+용어+정리 20160304
파이썬+주요+용어+정리 20160304파이썬+주요+용어+정리 20160304
파이썬+주요+용어+정리 20160304
Yong Joon Moon
 
나에 첫번째 자바8 람다식 지앤선
나에 첫번째 자바8 람다식   지앤선나에 첫번째 자바8 람다식   지앤선
나에 첫번째 자바8 람다식 지앤선
daewon jeong
 

Tendances (20)

파이썬+주요+용어+정리 20160304
파이썬+주요+용어+정리 20160304파이썬+주요+용어+정리 20160304
파이썬+주요+용어+정리 20160304
 
Python+numpy pandas 1편
Python+numpy pandas 1편Python+numpy pandas 1편
Python+numpy pandas 1편
 
Jupyter notebook 이해하기
Jupyter notebook 이해하기 Jupyter notebook 이해하기
Jupyter notebook 이해하기
 
Python+numpy pandas 4편
Python+numpy pandas 4편Python+numpy pandas 4편
Python+numpy pandas 4편
 
Python_numpy_pandas_matplotlib 이해하기_20160815
Python_numpy_pandas_matplotlib 이해하기_20160815Python_numpy_pandas_matplotlib 이해하기_20160815
Python_numpy_pandas_matplotlib 이해하기_20160815
 
파이썬+Operator+이해하기 20160409
파이썬+Operator+이해하기 20160409파이썬+Operator+이해하기 20160409
파이썬+Operator+이해하기 20160409
 
Python array.array 모듈 이해하기
Python array.array 모듈 이해하기Python array.array 모듈 이해하기
Python array.array 모듈 이해하기
 
파이썬+데이터+구조+이해하기 20160311
파이썬+데이터+구조+이해하기 20160311파이썬+데이터+구조+이해하기 20160311
파이썬+데이터+구조+이해하기 20160311
 
파이썬정리 20160130
파이썬정리 20160130파이썬정리 20160130
파이썬정리 20160130
 
파이썬 크롤링 모듈
파이썬 크롤링 모듈파이썬 크롤링 모듈
파이썬 크롤링 모듈
 
파이썬 기초
파이썬 기초 파이썬 기초
파이썬 기초
 
Reflect package 사용하기
Reflect package 사용하기Reflect package 사용하기
Reflect package 사용하기
 
R 기초 : R Basics
R 기초 : R BasicsR 기초 : R Basics
R 기초 : R Basics
 
강의자료4
강의자료4강의자료4
강의자료4
 
나에 첫번째 자바8 람다식 지앤선
나에 첫번째 자바8 람다식   지앤선나에 첫번째 자바8 람다식   지앤선
나에 첫번째 자바8 람다식 지앤선
 
파이썬+함수이해하기 20160229
파이썬+함수이해하기 20160229파이썬+함수이해하기 20160229
파이썬+함수이해하기 20160229
 
R 프로그래밍-향상된 데이타 조작
R 프로그래밍-향상된 데이타 조작R 프로그래밍-향상된 데이타 조작
R 프로그래밍-향상된 데이타 조작
 
[devil's camp] - 알고리즘 대회와 STL (박인서)
[devil's camp] - 알고리즘 대회와 STL (박인서)[devil's camp] - 알고리즘 대회와 STL (박인서)
[devil's camp] - 알고리즘 대회와 STL (박인서)
 
파이썬+Json+이해하기 20160301
파이썬+Json+이해하기 20160301파이썬+Json+이해하기 20160301
파이썬+Json+이해하기 20160301
 
R 프로그램의 이해와 활용 v1.1
R 프로그램의 이해와 활용 v1.1R 프로그램의 이해와 활용 v1.1
R 프로그램의 이해와 활용 v1.1
 

En vedette

1推動節約用水
1推動節約用水1推動節約用水
1推動節約用水
twnewone1
 
Intro to tsql unit 8
Intro to tsql   unit 8Intro to tsql   unit 8
Intro to tsql unit 8
Syed Asrarali
 
Save marriage vsl
Save marriage vslSave marriage vsl
Save marriage vsl
danimatrix
 
Kyiv Regional Session of EYP-Ukraine
Kyiv Regional Session of EYP-UkraineKyiv Regional Session of EYP-Ukraine
Kyiv Regional Session of EYP-Ukraine
Ev Melekhovets
 

En vedette (20)

Dr neha surana on scope&limitationofhomeopathyforneurologicaldisorders
Dr neha surana on scope&limitationofhomeopathyforneurologicaldisorders Dr neha surana on scope&limitationofhomeopathyforneurologicaldisorders
Dr neha surana on scope&limitationofhomeopathyforneurologicaldisorders
 
Cebit eurasia 2014 eng brochure
Cebit eurasia 2014 eng brochureCebit eurasia 2014 eng brochure
Cebit eurasia 2014 eng brochure
 
1推動節約用水
1推動節約用水1推動節約用水
1推動節約用水
 
Intro to tsql unit 8
Intro to tsql   unit 8Intro to tsql   unit 8
Intro to tsql unit 8
 
Lab15 tugjrel
Lab15 tugjrelLab15 tugjrel
Lab15 tugjrel
 
Olive Branch Health & Wellness
Olive Branch Health & Wellness Olive Branch Health & Wellness
Olive Branch Health & Wellness
 
Sowm 2014 exec_summary
Sowm 2014  exec_summarySowm 2014  exec_summary
Sowm 2014 exec_summary
 
The Oscar Iden Lecture Series. Lecture 3:The State of Individuals. Prof. Car...
The Oscar Iden Lecture Series.  Lecture 3:The State of Individuals. Prof. Car...The Oscar Iden Lecture Series.  Lecture 3:The State of Individuals. Prof. Car...
The Oscar Iden Lecture Series. Lecture 3:The State of Individuals. Prof. Car...
 
Step up your social game-Women of the Channel
Step up your social game-Women of the Channel Step up your social game-Women of the Channel
Step up your social game-Women of the Channel
 
Cebit Istanbul 2014 Sponsorship
Cebit Istanbul 2014 SponsorshipCebit Istanbul 2014 Sponsorship
Cebit Istanbul 2014 Sponsorship
 
Save marriage vsl
Save marriage vslSave marriage vsl
Save marriage vsl
 
Lacerta Bio Introduction nov 2013
Lacerta Bio Introduction nov 2013Lacerta Bio Introduction nov 2013
Lacerta Bio Introduction nov 2013
 
Nesia power point by nesiaunited.com
Nesia power point by nesiaunited.comNesia power point by nesiaunited.com
Nesia power point by nesiaunited.com
 
Felix moreno venegas
Felix moreno venegasFelix moreno venegas
Felix moreno venegas
 
9789740328735
97897403287359789740328735
9789740328735
 
Lab16
Lab16Lab16
Lab16
 
Kyiv Regional Session of EYP-Ukraine
Kyiv Regional Session of EYP-UkraineKyiv Regional Session of EYP-Ukraine
Kyiv Regional Session of EYP-Ukraine
 
Calendario matemático
Calendario matemáticoCalendario matemático
Calendario matemático
 
5+ping pong 4
5+ping pong 45+ping pong 4
5+ping pong 4
 
www.leader-milyarderunion.com | Preview Milyarer Union
www.leader-milyarderunion.com | Preview Milyarer Unionwww.leader-milyarderunion.com | Preview Milyarer Union
www.leader-milyarderunion.com | Preview Milyarer Union
 

Similaire à 강의자료3

[아꿈사] The C++ Programming Language 11장 연산자 오버로딩
[아꿈사] The C++ Programming Language 11장 연산자 오버로딩[아꿈사] The C++ Programming Language 11장 연산자 오버로딩
[아꿈사] The C++ Programming Language 11장 연산자 오버로딩
해강
 
공유 Jdk 7-2-project coin
공유 Jdk 7-2-project coin공유 Jdk 7-2-project coin
공유 Jdk 7-2-project coin
knight1128
 

Similaire à 강의자료3 (20)

강의자료 2
강의자료 2강의자료 2
강의자료 2
 
포트폴리오에서 사용한 모던 C++
포트폴리오에서 사용한 모던 C++포트폴리오에서 사용한 모던 C++
포트폴리오에서 사용한 모던 C++
 
5장 객체와클래스
5장 객체와클래스5장 객체와클래스
5장 객체와클래스
 
[아꿈사] The C++ Programming Language 11장 연산자 오버로딩
[아꿈사] The C++ Programming Language 11장 연산자 오버로딩[아꿈사] The C++ Programming Language 11장 연산자 오버로딩
[아꿈사] The C++ Programming Language 11장 연산자 오버로딩
 
2014.07.26 KSUG와 지앤선이 함께하는 테크니컬 세미나 - 나의 첫번째 자바8 람다식 (정대원)
2014.07.26 KSUG와 지앤선이 함께하는 테크니컬 세미나 - 나의 첫번째 자바8 람다식 (정대원)2014.07.26 KSUG와 지앤선이 함께하는 테크니컬 세미나 - 나의 첫번째 자바8 람다식 (정대원)
2014.07.26 KSUG와 지앤선이 함께하는 테크니컬 세미나 - 나의 첫번째 자바8 람다식 (정대원)
 
C review
C  reviewC  review
C review
 
Java advancd ed10
Java advancd ed10Java advancd ed10
Java advancd ed10
 
Ai C#세미나
Ai C#세미나Ai C#세미나
Ai C#세미나
 
Python
PythonPython
Python
 
공유 Jdk 7-2-project coin
공유 Jdk 7-2-project coin공유 Jdk 7-2-project coin
공유 Jdk 7-2-project coin
 
불어오는 변화의 바람, From c++98 to c++11, 14
불어오는 변화의 바람, From c++98 to c++11, 14 불어오는 변화의 바람, From c++98 to c++11, 14
불어오는 변화의 바람, From c++98 to c++11, 14
 
3주차 스터디
3주차 스터디3주차 스터디
3주차 스터디
 
STL study (skyLab)
STL study (skyLab)STL study (skyLab)
STL study (skyLab)
 
2015 Kitel C 언어 강좌3
2015 Kitel C 언어 강좌32015 Kitel C 언어 강좌3
2015 Kitel C 언어 강좌3
 
[SOPT] 데이터 구조 및 알고리즘 스터디 - #02 : 스택, 큐, 수식 연산
[SOPT] 데이터 구조 및 알고리즘 스터디 - #02 : 스택, 큐, 수식 연산[SOPT] 데이터 구조 및 알고리즘 스터디 - #02 : 스택, 큐, 수식 연산
[SOPT] 데이터 구조 및 알고리즘 스터디 - #02 : 스택, 큐, 수식 연산
 
C++ 프로그래밍 2014-2018년 기말시험 기출문제
C++ 프로그래밍 2014-2018년 기말시험 기출문제C++ 프로그래밍 2014-2018년 기말시험 기출문제
C++ 프로그래밍 2014-2018년 기말시험 기출문제
 
함수적 사고 2장
함수적 사고 2장함수적 사고 2장
함수적 사고 2장
 
파이썬 데이터과학 레벨2 - 데이터 시각화와 실전 데이터분석, 그리고 머신러닝 입문 (2020년 이태영)
파이썬 데이터과학 레벨2 - 데이터 시각화와 실전 데이터분석, 그리고 머신러닝 입문 (2020년 이태영)파이썬 데이터과학 레벨2 - 데이터 시각화와 실전 데이터분석, 그리고 머신러닝 입문 (2020년 이태영)
파이썬 데이터과학 레벨2 - 데이터 시각화와 실전 데이터분석, 그리고 머신러닝 입문 (2020년 이태영)
 
스파르탄스터디 E04 Javascript 객체지향, 함수형 프로그래밍
스파르탄스터디 E04 Javascript 객체지향, 함수형 프로그래밍스파르탄스터디 E04 Javascript 객체지향, 함수형 프로그래밍
스파르탄스터디 E04 Javascript 객체지향, 함수형 프로그래밍
 
Start IoT with JavaScript - 4.객체1
Start IoT with JavaScript - 4.객체1Start IoT with JavaScript - 4.객체1
Start IoT with JavaScript - 4.객체1
 

Plus de Young Wook Kim

Plus de Young Wook Kim (6)

강의자료8
강의자료8강의자료8
강의자료8
 
강의자료10
강의자료10강의자료10
강의자료10
 
강의자료9
강의자료9강의자료9
강의자료9
 
강의자료7
강의자료7강의자료7
강의자료7
 
강의자료6
강의자료6강의자료6
강의자료6
 
강의자료5
강의자료5강의자료5
강의자료5
 

강의자료3

  • 1. 제 2 장 자료설계와 구현
  • 2.
  • 3.
  • 4. Encapsulated C++ Data Type int Value range: INT_MIN . . INT_MAX Operations: + prefix - prefix + infix - infix * infix / infix % infix Relational Operators infix TYPE int (inside) Representation of int as 16 bits two’s complement + Implementation of Operations
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.