savitchch01-111003180700-phpapp01
savitchch01-111003180700-phpapp01
◼ Computer software is …
◼ The collection of programs used by a computer
◼ Includes:
◼ Editors
◼ Translators
◼ System Managers
◼ Workstation
◼ Larger and more powerful than a PC
◼ Mainframe
◼ Still larger
◼ Requires support staff
◼ Shared by multiple users
◼ Share information
◼ Main memory
◼ Memory locations containing the running program
◼ Secondary memory
◼ Permanent record of data often on a disk Display 1.1
Copyright © 2012 Pearson Addison-Wesley. All rights reserved. Slide 1- 8
Computer Memory
◼ Main Memory
◼ Long list of memory locations
secondary memory
◼ Fast
◼ Fixed in the computer and not normally removed
◼ Floppy disk
◼ Slow
◼ Easily shared with other computers
◼ Compact disk
◼ Slower than hard disks
◼ Easily shared with other computers
◼ Can be read only or re-writable
◼ Random Access
◼ Usually called RAM
◼ Sequential Access
◼ Data is generally found by searching through
add
subtract
multiply
divide
move data from location to location
◼ Is a program
◼ Some data
Display 1.3
ADD X Y Z
◼ Source code
◼ The original program in a high level language
◼ Object code
◼ The translated version in machine language
Display 1.4
◼ A Linker combines
◼ The object code for the programs we write
and
◼ The object code for the pre-compiled routines
into
◼ The machine language program the CPU can
run
Display 1.5
Copyright © 2012 Pearson Addison-Wesley. All rights reserved. Slide 1- 21
History Note
◼ First programmable computer
◼ Designed by Charles Babbage
◼ First programmer
◼ Ada Augusta, Countess of Lovelace
◼ Colleague of Babbage
◼ Algorithm
◼ A sequence of precise instructions that
leads to a solution
◼ Program
◼ An algorithm expressed in a language the
Display 1.6
Copyright © 2012 Pearson Addison-Wesley. All rights reserved. Slide 1- 25
Program Design
◼ Inheritance
◼ Writing reusable code
◼ Polymorphism
◼ A single name can have multiple meanings depending
on its context
a program?
#include <iostream>
using namespace std;
int main()
{
return 0;
}
Display 1.8
◼ Performs a computation
◼ ‘*’ is used for multiplication
◼ ‘=‘ causes total_peas to get a new value based on
the calculation shown on the right of the equal sign
◼ Program statement
on a line by themselves
◼ Indent statements
the program
◼ Statements (not always lines) end with a semi-colon
◼ Include Directives
#include <iostream>
◼ Tells compiler where to find information about items
cout
◼ Debugging
◼ Eliminating mistakes in programs
◼ Logic errors
◼ Errors in the program’s algorithm