Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Computers, Problem Solving, and Programming Chapter 1.

Similar presentations


Presentation on theme: "Introduction to Computers, Problem Solving, and Programming Chapter 1."— Presentation transcript:

1 Introduction to Computers, Problem Solving, and Programming Chapter 1

2 2 t Computer - “A device for counting or computing” t Dr. John Atanasoff - 1st computer. t ENIAC 1946 at U of Penn t Dr. John Von Neumann - Princeton –Stored program concept –Memory rather than wires and switches. t Computing History 1.1 Overview of Computers

3 3 t Von Neumann architecture basis for today's computers t VLSI Technology made computers affordable, small and available to the public t How programming has changed over time Overview of Computers

4 4 t Every computer is organized roughly into six parts –CPU - central processing unit Where decisions are made, computations are performed, and input/output requests are delegated –Main Memory Stores information being processed by the CPU –Secondary Memory Stores data and programs 1.2 Computer Hardware

5 5 –Input devices Allows people to supply information to computers –Output devices Allows people to receive information from computers –Network connection Modems / Ethernet interface Computer Hardware

6 6 Computer Components

7 7 Main Memory -27.2 l 354 l.005 75.62 l Address l Contents 0 1024 1

8 8 Main Memory t Stores –programs –data –results t Types –RAM –ROM

9 9 Secondary Memory & Storage t Semi permanent data-storage capability –Tape or Disk –Hard disk –CD ROM t Secondary memory has much more storage capacity

10 10 CPU t “Brains” of the computer –Arithmetic calculations are performed using the Arithmetic/Logical Unit or ALU –Control unit decodes and executes instructions t Arithmetic operations are performed using binary number system

11 11 CPU t Fundamental building block is a switch –Switches are made from ultrasmall transistors t Examples –The Pentium ® processor contains about three million transistors –The Pentium Pro ® has about 5.5 million transistors

12 12 Input / Output Devices t Accessories that allow computer to perform specific tasks –Receiving information for processing –Return the results of processing –Store information t Common input and output devices –PrinterJoystickCD-ROM –KeyboardMonitor

13 13 Computer Networks t LAN - Local area network –Organizational t WAN - Wide area network –Internet

14 14 World Wide Web t Introduced 1989 t Developed by CERN –European Laboratory for Particle Physics t Web browser –GUI –Netscape –IE

15 15 t Application software –Programs designed to perform specific tasks that are transparent to the user t System software –Programs that support the execution and development of other programs –Two major types Operating systems Translation systems 1.3 Computer Software

16 16 Application Software t Application software is the software that has made using computers indispensable and popular t Common application software –Word processors –Desktop publishing programs –Spreadsheets –Presentation managers –Drawing programs

17 17 t Controls and manages the computing resources t Important services that an operating system provides –File system –Commands that allow for manipulation of the file system –Ability to perform input and output on a variety of devices –Management of the running systems t Examples –MSDOS ®, Windows ®, Unix ® Operating System

18 18 Programming Languages t Machine Language –“Native tongue” of the computer –Binary 0s and 1s that specify what to do 0010 0000 0000 0100 1000 0000 0000 0101 0011 0000 0000 0110 t High - Level Languages –Resemble human language (C++, C, Pascal) cost = price + tax;

19 19 Programming Languages t Language Standard –Syntax (grammatical form) (rules) –Portable programs used without modification t Source Program t Object Program t Executable Program

20 20 Object Oriented Programming t OOP derived from C t Bjarne Stroustrup t Popular because of reuse –Classes –Objects t Organized in a Hierarchy –Super Classes –Sub Classes

21 21 OO Programming and Structured Programming t Object-oriented design and programming supports good software engineering t Object-oriented design promotes thinking about software in a way that models the real world

22 22 OO Programming and Structured Programming t Algorithms are the basis for the procedural sections (Structured Programs) –Highly structured –Top-down design –Step-wise refinement

23 23 Object Oriented Design t Abstraction –Extract the relevant properties of an object while ignoring inessential details t Encapsulation –Breaking down an object into parts, hiding and protecting its essential information, and supplying an interface to modify the information in a controlled and useful manner

24 24 Object Oriented Design t Modularity –Dividing an object into smaller pieces or modules such that the object is easier to understand and manipulate t Hierarchy –Ranking or ordering of objects based on some relationship between them

25 25 t Process of extracting only the relevant properties of an object t Extracted properties define a view of the object Abstraction

26 26 t Car dealer views a car from selling features standpoint –Price, warranty, color, etc. t Mechanic views a car from systems maintenance standpoint –Oil, oil filter, spark plugs, etc. Abstraction

27 27 Encapsulation t Breaking down an object into parts, hiding and protecting its essential information, and supplying an interface to modify the information in a controlled and useful manner t By hiding the information its representation and content can be changed without affecting other parts of the system

28 28 Encapsulation t Example - car radio –Controlled by switches and knobs –The details of how it works is hidden

29 29 Modularity t Dividing an object so that the object holds useful information and it is easier to understand t Most complex systems are modular –Cooling System –Ignition System –Fuel System

30 30 Modularity t Example - Automobile can be decomposed into subsystems –Cooling system Radiator Thermostat Water pump –Ignition system Battery Starter Spark plugs

31 31 Hierarchy t Ranking or ordering of objects based on some relationship between them t Hierarchies facilitate understanding complex organizations and systems –Example - a company hierarchy helps employees understand the structure of their company and their positions

32 32 OO Classes t Later we will use data abstractions –C++ language t Will apply OO techniques –Structured Programming –Object Oriented Programming t Model our own objects or abstractions

33 33 1.4 Processing a High-Level Language Program t Set of programs used to develop software t A key component of a is a translator t Types of translators –Compiler –Linker t Examples –g++, Borland C++ ®, Microsoft Visual C++ ®

34 34 Processing a Program t Editor used to enter the program –Source program (file.cpp) –UNIX vi text editor t Compiler translates the source program –Displays syntax errors (not descriptive) t Linker/Loader to combine object file with other object files –Executable program

35 35 Processing a Program t Major activities –Editing –Compiling –Linking with pre-compiled files Object files Library modules –Loading and executing –Viewing the behavior of the program

36 36 Process Cycle

37 37 1.5 Software Development Method t Problem Analysis - (Correct Problem) –Identify data objects –Goal to model properties –Determine Input / Output data –Constraints on the problem t Design –Decompose into smaller problems –Top-down design (divide and conquer) –Develop Algorithm (Desk check)

38 38 Software Development Method t Implementation –Writing the algorithm t Testing –Verify the program meets requirements –System and Unit test t Documentation –Key part in the development process

39 39 Software Development Method t Software engineering –Area of computer science concerned with building large software systems t Challenge –Tremendous advances in hardware have not been accompanied by comparable advances in software

40 40 Software Engineering Goals t Reliability –An unreliable life-critical system can be fatal t Understandability –Future development becomes very difficult if software is hard to understand t Cost Effectiveness –Cost to develop and maintain should not exceed profit

41 41 Software Engineering Goals t Adaptability –System that is adaptive is easier to alter and expand t Reusability –Improves reliability and maintainability, and reduces development costs

42 42 1.6 Applying the Software Development Method t Case Study:Converting Miles to Kilometers –Problem Your summer surveying job requires you to study some maps that give distances in kilometers and some that use miles. You and your coworkers prefer to deal in metric measurements. Write a program that performs the necessary conversion.

43 43 Applying the Software Development Method –Analysis The first step in solving this problem is to determine what you are asked to do. You must convert from one system of measurement to another, but are you supposed to convert from kilometers to miles, or vice versa? The problem states that you prefer to deal in metric measurements, so you must convert distance measurements in miles to kilometers.

44 44 Applying the Software Development Method –Design The next step is to formulate the algorithm that solves the problem. Begin by listing the three major steps, or sub problems, of the algorithm. –Implementation To implement the solution, you must write the algorithm as a C++ program. –Testing How do you know the sample run is correct?

45 45 1.7 Professional Ethics for Computer Programmers t Privacy and Misuse of Data t Computer Hacking t Plagiarism and Software Piracy t Misuse of a Computer Resource


Download ppt "Introduction to Computers, Problem Solving, and Programming Chapter 1."

Similar presentations


Ads by Google