39f6c664185f2f37b3d0281de31eda5a.ppt
- Количество слайдов: 58
Chapter Four • Software Basics: The Ghost in the Machine
Chapter Outline • Processing with Programs • Application Software: Tools for Users • System Software: The Hardware. Software Connection • The User Interface: The Human. Machine Connection 1999 Addison Wesley Longman 2
Processing with Programs • Software programs: – Are invisible and complex – Must be clear – Must be free of errors – Are a set of instructions that tell a computer what to do 1999 Addison Wesley Longman 3
A Fast, Stupid Machine • Computers: – Have limited capabilities – Can only do basic mathematics and logical comparisons – Must be instructed with programs what to do 1999 Addison Wesley Longman 4
The Language of Computers • Programmers begin with an algorithm, which is: – A set of step-by-step instructions (written in a natural language, e. g. , English) • Algorithms are translated into the vocabulary of a programming language 1999 Addison Wesley Longman 5
Flow Chart (I) • • • process decision terminal joint flow line 1999 Addison Wesley Longman 6
Flow Chart (II) • predefined procedure • input • output • I/O 1999 Addison Wesley Longman 7
Control Structures • sequential execution ( concatenation ) • conditional execution ( alternation ) • looping ( iteration ) 1999 Addison Wesley Longman 8
Top-Down Structure Design • • define the problem design the algorithm as procedures refine the procedures into pseudo code the program 1999 Addison Wesley Longman 9
Programming Languages • Programming languages bridge the gap between the natural language of the human and the numeric codes (zeros and ones) understood by the computer • Examples include: – COBOL, BASIC, and C++ 1999 Addison Wesley Longman 10
Programming Languages • low level languages – machine language – assembly language (symbolic language) • high level languages – machine independent – problem oriented – familiar notations 1999 Addison Wesley Longman 11
High Level Languages • 1957 • 1960 Z • 1965 • 1971 • 1972 Fortran COBOL Z=X+Y ADD X TO Y GIVING BASIC Z=X+Y Pascal z: =x+y; C z=x+y; 1999 Addison Wesley Longman 12
High Level Languages • 1980 • 1985 • 1990 Ada C++ Java 1999 Addison Wesley Longman 13
Sorting ( Ordering ) • internal sort • external sort 1999 Addison Wesley Longman 14
Internal Sort • straight – exchange ( bubble sort ) – insertion sort – selection sort • advanced – shell sort – heap sort – quick sort 1999 Addison Wesley Longman 15
Bubble Sort • • • 44 55 12 42 94 18 06 67 06 44 55 12 42 94 18 67 06 12 44 55 18 42 94 67 06 12 18 44 55 42 67 94 06 12 18 42 44 55 67 94 1999 Addison Wesley Longman 16
Bubble Sort • • • 1000 1010 1020 1030 1040 1050 1060 1070 1080 1090 REM bubblesort subroutine FOR M = 2 to N FOR I=N to M step -1 IF A(I-1) <= A(I) THEN 1070 TEMP = A(I-1) = A(I) = TEMP NEXT I NEXT M RETURN 1999 Addison Wesley Longman 17
Insertion Sort • • 44 55 12 42 94 18 06 67 44 55 12 42 44 55 94 12 18 42 44 55 94 06 12 18 42 44 55 67 94 1999 Addison Wesley Longman 18
Insertion Sort • procedure straightinsertion • var i, j: index; x: integer; • begin • for i : = 2 to n do begin • x : = a[i]; a[0] : = x; j : = i-1; • while x< a[j] do • begin a[j+1] : = a[j]; j : = j-1 end; • a[j+1] : = x; • end; 1999 Addison Wesley Longman 19
Selection Sort • • • 44 55 12 42 94 18 06 67 06 55 12 42 94 18 44 67 06 12 55 42 94 18 44 67 06 12 18 42 94 55 44 67 06 12 18 42 44 55 94 67 06 12 18 42 44 55 67 94 1999 Addison Wesley Longman 20
Selection Sort • for (i=1; i<n; i++) { • min = i; • for( j= i+1; j<n; j++) • if (a[j] < a[min]) min= j; • temp= a[i]; • a[i] = a[min]; • a[min] = temp; • }; 1999 Addison Wesley Longman 21
Shell sort • • 4 sort • 2 sort • 1 sort 44 55 12 42 94 18 06 67 44 18 06 42 94 55 12 67 06 18 12 42 44 55 94 67 06 12 18 42 44 55 67 94 • each pass profits from previous pass • diminishing increment yields better result 1999 Addison Wesley Longman 22
Heap sort • 44 55 12 42 | 94 • 44 55 12 | 42 94 • 44 55 | 06 42 94 • 44 | 42 06 55 94 • | 06 42 12 55 94 • • • 18 18 18 06 06 12 12 44 67 67 67 12 42 18 55 94 67 44 | 06 18 42 44 55 94 67 | 12 06 42 55 44 67 94 | 18 12 06 1999 Addison Wesley Longman 23
Quick sort • • 44 55 12 42 94 06 18 67 18 06 12 42 94 55 44 67 1999 Addison Wesley Longman 24
Application Software: Tools for Users • Software applications include: – Consumer software – Integrated software – Vertical-market and custom software 1999 Addison Wesley Longman 25
Consumer Applications • There are thousands of different consumer software titles • Consumer software differs based on: – Documentation – Upgradability – Compatibility – Warranty – Extent of ownership/license 1999 Addison Wesley Longman 26
Documentation • Documentation includes: – Printed tutorial and reference manuals that explain how to use the software – On-line manuals and help screens which offer immediate help to the user 1999 Addison Wesley Longman 27
Upgrades • Rather than buy the latest version and discard your old one, often you can pay a fee to the software maker and upgrade the old version to the new one • Newer versions of a software company’s product usually have additional features and fewer bugs 1999 Addison Wesley Longman 28
Compatibility • Compatibility means the software will function properly with the hardware, operating system, and any peripherals • To date, there is no industry standard that software must follow 1999 Addison Wesley Longman 29
Warranty • Buyer beware! • Software manufacturers limit their liability for software problems by selling their software “as is” • Error-free software does not exist 1999 Addison Wesley Longman 30
Ownership/Licensing • Three categories: – Purchased software grants you a license to use the software as the software company tells you – Shareware software is free for the trying, but a nominal fee is to be paid to the programmer if you continue to use it – Public domain software is legally free and cannot be owned or licensed 1999 Addison Wesley Longman 31
Integrated Applications and Suites: Multipurpose Software • Multipurpose software that includes most of these modules: – Word processing – Database – Spreadsheet – Graphics – Telecommunications 1999 Addison Wesley Longman 32
Integrated Software: Advantages • Costs less than buying the applications individually • Data is easily transferred between modules • Commands used in each module are usually the same • Usually there is a seamless integration of the modules 1999 Addison Wesley Longman 33
Vertical-Market and Custom Software • Job-specific software: – Medical billings – Library cataloging – Restaurant management – Single-client software needs 1999 Addison Wesley Longman 34
System Software: The Hardware-Software Connection • Operating Systems • Language Processors • Utility Programs 1999 Addison Wesley Longman 35
Language Processors • Assemblers • Compilers • Interpreters 1999 Addison Wesley Longman 36
What the Operating System Does • The operating system controls: – Communication with peripherals – Coordination of concurrent processing – Memory management – Monitoring of resources and security – Management of programs and data – Coordinating network communications 1999 Addison Wesley Longman 37
Operating System • to make users comfortable • to make machines efficient • MS-DOS – single user, single-task • WINDOWS – single user, multi-task • Unix – multi user, multi-task 1999 Addison Wesley Longman 38
Microsoft O. S. • 1980 MS-DOS – text mode • 1990 MS-Windows 3. 0 – graphic mode – multi-tasking • 1995 MS-Windows 95 – native O. S. – plug & play – network management 1999 Addison Wesley Longman 39
Microsoft O. S. (II) • 1998 MS-Windows 98 – Web integration – support multi-medium • 2000 MS-Windows Me – more reliable 1999 Addison Wesley Longman 40
Utility Programs • Utility software controls tasks such as: – repairing damaged files – making it easy for users to copy files from one storage device to another – translating files so different software can read them – guarding against viruses 1999 Addison Wesley Longman 41
The User Interface: The Human-Machine Connection • The user interface is what the user sees on the screen and interacts with • Two major user interface types: – Character-based interface – Graphical user interface 1999 Addison Wesley Longman 42
A Character-Based User Interface: MS-DOS • This is a disk operating system in which the user interacts with characters – letters – numbers – symbols 1999 Addison Wesley Longman 43
A Character-Based User Interface: MS-DOS • MS-DOS™ is the most widely used general-purpose operating system • Features include: – Command-line interface (commands are typed) – Menu-driven interface (commands are chosen from on-screen lists) 1999 Addison Wesley Longman 44
Graphical User Interfaces: Macintosh • This is a disk operating system in which the user interacts with the computer by using a pointing device (e. g. a mouse) • As early as 1984, the Macintosh™ computer was designed with this interface in mind 1999 Addison Wesley Longman 45
Graphical User Interfaces: Windows • In 1995, Windows 95™ was released as a graphical user interface for IBM™ computers and their compatibles 1999 Addison Wesley Longman 46
Why WIMP Won • Windows, Icons, Menus, and Pointing devices • In this graphical user interface, the cursor of the pointing device (mouse) appears on the screen and can be used to point to icons, work within windows, and select from menus 1999 Addison Wesley Longman 47
Tomorrow’s User Interfaces • Future interfaces will probably: – Make individual applications obsolete – Support natural languages (talk to the machine and it talks back) – Include artificial intelligence and agents that fit our needs – Be based on virtual reality (data in three-dimensional physical space) 1999 Addison Wesley Longman 48
Rules of Thumb: Computer Consumer Concepts Before you buy, you should consider: • • • Cost Compatibility Capacity Customizability Capability Connectivity 1999 Addison Wesley Longman • Convenience • Company • Purchasing Curve 49
Cost • Before you buy: – Determine what you can afford – Allow for “extras” – Join a user group or talk with other computer and software owners 1999 Addison Wesley Longman 50
Compatibility • Before you buy, make sure you know: – What is the right computer and software for what you want to do – If the computer and software you will need work well together 1999 Addison Wesley Longman 51
Capacity • Before you buy, make sure you know: – How much computer power you are going to need – If the processor will be able to handle your demands – If you will be able to upgrade later on 1999 Addison Wesley Longman 52
Customizability • Before you buy, make sure you know: – If your computer can be customized to fit your needs (such as video editing) 1999 Addison Wesley Longman 53
Capability • Before you buy, make sure you know: – Which computer is the right tool for you – If the computer and software will be able to meet your demands today and years from now 1999 Addison Wesley Longman 54
Connectivity • Before you buy, make sure you: – Have included a high-speed modem or some other network connection – Can take full advantage of the communication capabilities of your computer 1999 Addison Wesley Longman 55
Convenience • Before you buy, make sure you determine: – Whether portability or permanent connection of peripherals is important – Which kind of user interface will help you do your work easier – If you should have the same machine as people around you 1999 Addison Wesley Longman 56
Company • Before you buy, make sure you know: – if you are buying from a reputable company – if parts and service will be available if needed 1999 Addison Wesley Longman 57
Purchasing Curve • Most models of personal computers seem to have a useful life span of just a few years • Before you buy, make sure you know: – how new or old the computer is that you want to buy – not to buy a brand new computer model – not to buy an “obsolete” computer model 1999 Addison Wesley Longman 58
39f6c664185f2f37b3d0281de31eda5a.ppt