1/84
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Computer program
A set of instructions for a computer to follow.
Computer software
The collection of programs used by a computer.
PCs (Personal Computer)
Relatively small computers used by one person at a time.
Workstation
Larger and more powerful than a PC.
Mainframe
Still larger than a workstation, requires support staff, and is shared by multiple users.
Networks
A number of computers connected to share resources, printers, devices, and information.
Input devices
Allows communication to the computer.
Output devices
Allows communication to the user.
Processor (CPU)
The main component that follows program instructions.
Main memory
Memory locations containing the running program.
Secondary memory
Permanent record of data often on a disk.
Binary Digit or Bit
A digit that can only be zero or one.
Byte
Each memory location has eight bits.
Address
Number that identifies a memory location.
Larger Data Items
Some data is too large for a single byte; most integers and real numbers are too large.
Data or Code
Interpretation of binary data depends on the current instruction.
File
Stores data or instructions in secondary memory.
Hard disk
Fast secondary memory, fixed in the computer and not normally removed.
Floppy disk
Slow secondary memory, 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, allows the computer to directly access any memory location.
Sequential Access
Data is generally found by searching through other items first, more common in secondary memory.
Central Processing Unit (CPU)
Typically called the CPU, follows program instructions and performs operations like add, subtract, multiply, divide, and move data from location to location.
Operating System
A program that allows us to communicate with the computer, allocates the computer's resources, and responds to user requests to run other programs.
Common Operating Systems
Examples include UNIX, Linux, DOS, Windows, Macintosh, and VMS.
Computer Input
Consists of a program and some data.
High-level Languages
Programming languages that resemble human languages and are designed to be easy to read and write.
Examples of High-level Languages
C, C++, Java, Pascal, Visual Basic, FORTRAN, Perl, PHP, Lisp, Scheme, Ada, C#, Python.
Translation of High-level Languages
High-level languages must be translated to zeros and ones for the CPU to execute a program.
Low-level Languages
Languages that include assembly language, which must be translated to machine language (zeros and ones).
Assembly Language Command
An example is ADD X Y Z, which means add the values found at x and y in memory, and store the result in location z.
Machine Language
The language that the CPU can follow, represented in binary (e.g., 0110, 1001, 1010, 1011).
Compilers
Programs that translate high-level language to machine language.
Source Code
The original program written in a high-level language.
Object Code
The translated version of the source code in machine language.
Linkers
Programs that combine object code for the programs we write and object code for pre-compiled routines into a machine language program.
First Programmable Computer
Designed by Charles Babbage, began work in 1822, but was not completed in his lifetime.
First Programmer
Ada Augusta, Countess of Lovelace, a colleague of Babbage.
Algorithm
A sequence of precise instructions that leads to a solution.
Program
An algorithm expressed in a language the computer can understand.
Program Design Process
Includes the Problem Solving Phase and Implementation Phase.
Problem Solving Phase
Involves specifying the task completely, determining input and output, organizing output, and developing the algorithm before implementation.
Testing the Algorithm
Experience shows that testing the algorithm for correctness saves time in getting your program to run.
Implementation Phase
Translate the algorithm into a programming language.
Compile
Locates errors in using the programming language.
Run the program
Verify correctness of results.
Object Oriented Programming
Abbreviated OOP, used for many modern programs.
Encapsulation
Objects contain their own data and algorithms.
Inheritance
Objects can inherit characteristics from other objects.
Polymorphism
A single name can have multiple meanings depending on its context.
Software Life Cycle
Analysis and specification of the task (problem definition).
C++
Derived from the C language.
C
Developed by Dennis Ritchie at AT&T Bell Labs in the 1970s.
C++ History
C++ developed by Bjarne Stroustrup at AT&T Bell Labs in the 1980s.
Sample C++ Program
A simple C++ program begins with #include
Variable Declaration
Identifies names of three variables to name numbers.
cout
Used for output to the monitor.
cin
Used for input from the keyboard.
Computation
Performs a computation using the '*' operator for multiplication.
Program Layout
Compiler accepts almost any pattern of line breaks and indentation.
Program Formatting
Programmers format programs so they are easy to read.
Braces Placement
Place opening brace '{' and closing brace '}' on a line by themselves.
Statement Indentation
Indent statements.
Single Statement per Line
Use only one statement per line.
Variable Declaration Location
Typically variables are declared at the beginning of the program.
Statement Terminator
Statements (not always lines) end with a semi-colon.
Include Directives
#include
iostream Library
iostream is a library containing definitions of cin and cout.
Namespace Usage
using namespace std; tells the compiler to use names in iostream in a 'standard' way.
Main Function Start
To begin the main function of the program, use int main() {.
Main Function End
To end the main function, use return 0;.
C++ Source Code
C++ source code is written with a text editor.
Compiler Function
The compiler on your system converts source code to object code.
Linker Function
The linker combines all the object code into an executable program.
C++11
C++11 (formerly known as C++0x) is the most recent version of the standard of the C++ programming language.
C++11 Approval Date
Approved on August 12, 2011 by the International Organization for Standardization.
C++11 Compiler Compatibility
C++11 language features are not supported by older compilers.
Compiling C++11
Check the documentation with your compiler to determine if special steps are needed to compile C++11 programs.
g++ Extra Flags
With g++, use extra flags of -std=c++11.
Running a Program
Obtain code in Display 1.10, compile the code, fix any errors the compiler indicates and re-compile the code, then run the program.
Bug
A mistake in a program.
Debugging
Eliminating mistakes in programs.
Logic Errors
Errors in the program's algorithm that are most difficult to diagnose.
Syntax Errors
Violation of the grammar rules of the language discovered by the compiler.
Run-time Errors
Error conditions detected by the computer at run-time.