CSCE 1001 Chapter 1
CSCE 1001 Chapter 1
Computer software is …
The collection of programs used by a computer
Includes:
Editors
Translators
System Managers
Hardware
Three main classes of computers
Workstation
Larger and more powerful than a PC
Mainframe
Still larger
Requires support staff
Shared by multiple users
Networks
Share information
Computer Organization
Main memory
Memory locations containing the running program
Secondary memory
Permanent record of data often on a disk
Computer Organization (cont.)
Computer Memory
Main Memory
Long list of memory locations
secondary memory
Secondary Memory Media
A computer might have any of these
types of secondary memory
Hard disk
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
Memory Access
Random Access
Usually called RAM
Sequential Access
Data is generally found by searching through
add
subtract
multiply
divide
move data from location to location
Computer Software
The operating system
Allows us to communicate with the computer
Is a program
Some data
High-level Languages
Common programming languages include …
ADD X Y Z
Source code
The original program in a high level language
Object code
The translated version in machine language
Compilers
Linkers
Some programs we use are already compiled
Their object code is available for us to use
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
Linkers
History Note
First programmable computer
Designed by Charles Babbage
First programmer
Ada Augusta, Countess of Lovelace
Colleague of Babbage
Section 1.1 Conclusion
Can you…
List the five main components of a computer?
Algorithm
A sequence of precise instructions that
leads to a solution
Program
An algorithm expressed in a language the
Inheritance
Writing reusable code
Polymorphism
A single name can have multiple meanings depending
on its context
Software Life Cycle
a program?
#include <iostream>
using namespace std;
int main()
{
return 0;
}
A Sample C++
Program
Explanation of code (1/5)
Variable declaration line
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
Explanation of code (5/5)
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
Program Layout (3/3)
using namespace std;
Tells the compiler to use names in iostream in
a “standard” way
Debugging
Eliminating mistakes in programs
Logic errors
Errors in the program’s algorithm