290 likes | 506 Views
이 세상의 첫날 , 신께서 말하시길 『 class Light { public: BOOL Init(const World& worldTarget); BOOL Create(v3d v3Pos, v3d v3Dir); BOOL Reposition(v3d v3Pos); BOOL Redirection(v3d v3Dir); BOOL SetOn(); BOOL IsOn(); BOOL SetOff(); private: const World* mpWorld_Belong; v3d mV3_Position;
E N D
이 세상의 첫날, 신께서 말하시길 『 class Light { public: BOOL Init(const World& worldTarget); BOOL Create(v3d v3Pos, v3d v3Dir); BOOL Reposition(v3d v3Pos); BOOL Redirection(v3d v3Dir); BOOL SetOn(); BOOL IsOn(); BOOL SetOff(); private: const World* mpWorld_Belong; v3d mV3_Position; v3d mV3_Direction; } 』 라 하여 빛이 탄생하였다. 프로그래밍을 설명하는 그림
C++ Programming Practice Time Week 1.
To do in orientation • Introduce • What is Information System? • About what to do & what will do • To do in this time • Exam & Point • Compile Environment • C++ & OOP • Procedural vs Object Oriented • Hello C++
Introduce • 한양대학교 정보통신학부 컴퓨터전공과 08학번 • 한양대학교 일반대학원 정보시스템학과 12학번 • Teaching Assistant of Prof. Kutzner
What is IS, IT, Programming, C++? • IS : IT를 올바른 방법으로 조직에 적용시키는 것 • IT : Hardware, Software, Network, Data Manage • Programming : 소프트웨어저작 • C++ : 프로그래밍을 위한 언어
To do in this time • C에 대한 내용을 복습 • 프로그래밍이 아닌 순수 C++을 학습 • C++ 이론 시간에 이해 못했던 부분에 복습 • C++ 실습을 위한 학습
Exam & Point • 채점 – 정답점수, 부분점수 • 시험 후 – 시험지 확인은 자유로움 • 만약 정당하지 못한 점수 상승을 요구할 시에 는 해당 학생의 모든 부분 점수를 0점 처리 할 것임
Compile Environment • Microsoft Visual C++ 2008 • Free Download : www.dreamspark.com • (Require Register Hanyang Email to site) • Microsoft Student Software Assist Page
C++ & OOP • C++ • Extension Language of C for supporting OOP • OOP : Object Oriented Programming • Object : Abstract Concept about something • C : Memory and Logic Design • C++ : Model and Communication Design
Procedural vs Object Oriented • Example : Snake Game Design
Hello C++ #include <iostream> int main() { std::cout << “Hello World\n”; return 0; }
C Basic • Preprocessing • Variables • Literals • Expressions • Precedence • Operator • Control Structures • Conditions • Compound Statements(block)
Von Neumann Architecture Memory Control Unit Arithmetic Logic Unit Accumulator Input Output
Von Neumann Architecture • Memory • F3 is X • E2 is Y • B4 is Z • Z = X + Y • Z is70
Von Neumann Architecture • Instruction • F3 is X • E2 is Y • B4 is Z • Z = X + Y • Z is70
Von Neumann Architecture • Output • F3 is X • E2 is Y • B4 is Z • Z = X + Y • Z is70
Memory Structure Addresses Memory Cells 0000 0x54 0001 0x45 A1 0002 0x58 B1 0003 0x54 C1 0004 0x00 D1 0005 0x06 E1 F1 Content of a memory cell
Programming Language • Machine • Assembler • Fortran, Cobol, Lisp • C
Machine • Assign Instruction in Hardware Unit • Ex) AAABBBCCC • AAA : Instruction • BBB : Storage1 • CCC : Storage2
Machine • Ex: AAABBBCCC • Number to Symbol • 001 : B = B + C => add • 010 : B = B – C => sub • 011 : B = B / C => div • 100 : B = B * C => mul • 101 : B = C => ass • Naming Storage • 001 : A • 010 : B • 011 : C • Ex: AAABBBCCC • Instructions • (Storage Default Value : 1) • 001001010 • 101010001 • 100001010 • 001001011 • Q : Result of Storage001?
Machine • Ex: AAABBBCCC • Number to Symbol • 001 : B = B + C => add • 010 : B = B – C => sub • 011 : B = B / C => div • 100 : B = B * C => mul • 101 : B = C => ass • Naming Storage • 001 : A • 010 : B • 011 : C • Ex: AAABBBCCC • Instructions • (Storage Default Value : 1) • [001][001][010] addA B • [101][010][001] assB A • [100][001][010] mulA B • [001][001][011] addA C • Q : Result of Storage001? A = ?
Machine • Ex: AAABBBCCC • Instructions • (Storage Default Value : 1) • [001][001][010] addA B • [101][010][001] assB A • [100][001][010] mulA B • [001][001][011] addA C • Q : Result of Storage001? A = ? 5 • Ex: AAABBBCCC • Number to Symbol • 001 : B = B + C => add • 010 : B = B – C => sub • 011 : B = B / C => div • 100 : B = B * C => mul • 101 : B = C => ass • Naming Storage • 001 : A • 010 : B • 011 : C A = A + B B = A A = A * B A = A + C
Assembler • Ex: AAABBBCCC • Change Number to Symbol • 001 : B = B + C => add • 010 : B = B – C => sub • 011 : B = B / C => div • 100 : B = B * C => mul • 101 : B = C => ass
Fortran, Cobol, Lisp • Assembler is difficult • Assembler has different instruction and structureeach machine • add A B • ass B A • mul A B • add A C • Require more high level language • A = A + B • B = A • A = A * B • A = A + C
C • C is made to develop Unix OSis background of Windows, Mac OS, Linux, etc. • Clear and systematic grammatical structure • Very fast due to dealing low level • Hard to deal than other high level language
Von Neumann Architecture • Memory • F3 is X • E2 is Y • B4 is Z • Z = X + Y • Z is70
Variable • Variable • F3 is X • E2 is Y • B4 is Z • Variable is changing values that are hard to remember to symbol that can recognize easily • Z = X + Y • It is more is to rememberX, Y, Z than F3, E2, B4 when you need to calculate • B4 = F3 + E2 vs Z = X + Y