Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 1 – pp 1 – 44 C++ program design by Cohoon & Davidson

Similar presentations


Presentation on theme: "Lecture 1 – pp 1 – 44 C++ program design by Cohoon & Davidson"— Presentation transcript:

1 Lecture 1 – pp 1 – 44 C++ program design by Cohoon & Davidson
C++ programming Lecture 1 – pp 1 – 44 C++ program design by Cohoon & Davidson y k choi

2 Computing and the object-oriented design methodology
Basic computing terminology Software Engineering software Object-oriented design Summary Pay attention to software and object-oriented design y k choi 2/23/2019

3 Introduction – why OOP Computers become indispensable facilities to make our lives easier and more comfortable if we can master them. Computers rely on programs written by programmers to control its operations. Software, nowadays, particularly, objected-oriented programming (OOP) has emerged for managing complex software development. y k choi 2/23/2019

4 Basic Computing Terminology
Computing unit – response time and storage size Computer organization – four components Programming – basic assembly language y k choi 2/23/2019

5 Computing unit Computers are measured in terms of processing power – response time and its capacity MIPS – million instructions per second. This is a performance indicator. It is related to the size of common system bus. 5 MIPS is better than 3 MIPS. Twenty years ago – IBMPC, the memory was 64K. Nowadays, the memory is 256/512 M Bytes AT that time, IBM XT means having a hard disk of 10M. Nowadays, the storage capacity of a hard disk is 40G. y k choi 2/23/2019

6 Computer Organization
A computer consists of four components - ALU, memory, storage and I/O Load instruction from memory and execute in CPU, store result to memory, disk or I/O y k choi 2/23/2019

7 Fetch and Execute cycle
Write to hard disk fetch y k choi 2/23/2019

8 Binary Numbers Integers – C++ uses 4 bytes to represent integer and 2’s complement to represent negative numbers C++ uses one byte ASCII to represent alphanumeric characters C++ uses 4 bytes (single precision) and IEE754 to represent floating point numbers. C++ uses 2 bytes uni-code to represent non-English characters (Chinese and Japanese) y k choi 2/23/2019

9 You can play around with C++ later
Integers -positive Decimal 1: (binary) Note that the most significant byte ( ) is stored in the highest memory location. That is if a location of 400 is used to store the above integer. The location is: Address 400: Address 401: Address 402: Address 403: You can play around with C++ later y k choi 2/23/2019

10 Negative numbers – 4 bytes in C++
Determine -1 decimal in 2’s complement Step 1: write down the positive number first Step 2: inverse it Step 3: add 1 The purpose of using 2’s complement is to convert subtraction into addition, as there is no subtractor in CPU y k choi 2/23/2019

11 It means a computer sending a pattern such as can be interpreted by all using this standard. ASCII values It was for communications and is now used for internal code. Alphanumeric value Binary value Hexadecimal value 30 1 31 a 61 A 41 y k choi 2/23/2019

12 You can see high level language reduce the time to program computer
Programming (pp14-18) A computer is a hardware consisting of four components. It needs a program to direct the computer to perform some specific task. The lowest level is machine language, while C++ is high level language In c++, c = a + b; //one statement Machine language: at least three statements You can see high level language reduce the time to program computer y k choi 2/23/2019

13 Logistics system? : application
Software (pp18 – 22) There are two main types: System software such as those for operating systems, Windows 98/2000, Linux, OS400 (for AS400), game engine (border line) Application software such as inventory control, game, games, e-auction, personnel management Logistics system? : application y k choi 2/23/2019

14 Relationship among hardware, system software and application software
y k choi 2/23/2019

15 System software Software that controls and manages the computing resources Resources include memory, I/O devices and CPU OS provides services such as memory allocation and I/O control y k choi 2/23/2019

16 Development process for C++
Compile Edit Link Source code Load Think Execute y k choi 2/23/2019

17 System software Software that controls and manages the computing resources Resources include memory, I/O devices and CPU OS provides services such as memory allocation and I/O control

18 Object-oriented design (1)
It promotes thinking about software in a way that more closely models the way we think about interact with the real world. You start to watch TVB You take the remote control You select channel number You lay down in the sofa and enjoy the show y k choi 2/23/2019

19 Object-oriented design (2)
You picked up the remote control (logical object) The object has properties like weight and size You don’t know how it works but knows how to push button You push the button (interacting with TV) The TV is an object with various properties y k choi 2/23/2019

20 Summary Basic hardware: CPU, memory, storage and I/O
Data: Integer, floating point, ASCII Language: low level to high level (C++) Software: system software and application software OOB: treat module as object C++: object oriented language y k choi 2/23/2019


Download ppt "Lecture 1 – pp 1 – 44 C++ program design by Cohoon & Davidson"

Similar presentations


Ads by Google