Προγραμματισμός
Topic outline
-
-
•What is this course about?
•What should you already know?
•What will you be expected to do?
•What will you know when you finish
•What is programming
•Applications of programming
•A simple program
-
Strings and string I/O
Integers and integer I/O
Types and objects
Type safety
-
Computation
- What is computable? How best to compute it?
- Abstractions, algorithms, heuristics, data structures
Language constructs and ideas
- Sequential order of execution
- Expressions and Statements
- Selection
- Iteration
- Functions
- Vectors
-
Kinds of errors
Argument checking
- Error reporting
- Error detection
- Exceptions
Debugging
Testing
-
Some thoughts on software development
The idea of a calculator
Using a grammar
Expression evaluation
Program organization
-
Tokens and token streams
- Classes and structs
Cleaning up the code
- Prompts
- Program organization
-- constants
- Recovering from errors
- Commenting
- Code review
- Testing
A word on complexity and difficulty
-
Language Technicalities
Declarations
- Definitions
- Headers and the preprocessor
- Scope
Functions
- Declarations and definitions
- Arguments
Call by value, reference, and const reference
Namespaces
- “Using” statements
Recursive functions
-
Classes
- Implementation and interface
- Constructors
- Member functions
Enumerations
Operator overloading
Useful headers in C++
-
Fundamental I/O concepts
Files
- Opening
- Reading and writing streams
I/O errors
Reading a single integer
-
Input and output
Numeric output
- Integer
- Reading and writing streams
- Floating point
File modes
- Binary I/O
- Positioning
String streams
Line-oriented input
- Character input
- Character classification
-
Why graphics?
A graphics model
Examples
-
Graphing
- Model
- Code organization
Interface classes
- Point
- Line
- Lines
- Grid
- Open Polylines
- Closed Polylines
- Color
- Text
- Unnamed objects
S/W libraries
-
Perspective
-I/O alternatives
-GUI
-Layers of software
GUI example
GUI code
-callbacks
-
Vector revisited
- How are they implemented?
Pointers and free store
- Allocation (new)
- Access
--- Arrays and subscripting: []
--- Dereferencing: *
- Deallocation (delete)
-
Destructors
Copy constructor and copy assignment
Arrays
-
Changing size
- resize() και push_back()
Templates
Range checking and exceptions
-
Common tasks and ideals
Generic programming
Containers, algorithms and iterators
The simplest algorithm: find ()
Parameterization of algorithms
- find_if() and function objects
Sequence containers
- vector and list
-
Associative containers
- map, set
Standard algorithms
- copy, sort, ...
- Input iterators and output iterators
List of useful facilities
- Headers, algorithms, containers, function objects
-
Ideals
- Aims, heroes, techniques
Languages and language designers
- Early languages to C++
-
Strings
I/O
Precision, overflow, sizes, errors
Matrices
Random numbers
Complex numbers
examples
-
Correctness, proofs, and testing
Dependencies
System tests
Testing GUIs
Resource management
Unit and system tests
Finding assumptions that do not hold
Design for testing
Performance
-
C and C++
Function prototypes
printf()/scanf()
Arrays and strings
Memory management
Macros
const
C/C++ interoperability