The programming is the process of software design.
It consists of the application domain knowledge, data structure / database
design and implementation in a specific programming language.
The domain knowledge includes the system feasibility study, system analysis,
and prototype system design. The domain knowledge involves not only the
data structure and data model design, but also the algorithms applied to
solve the tasks on hand.
The data structure is the data model and class / object design which will present the overall system structure and work with the alforithm side by side.
The communication/networking, database and the data model are also part of the data structure design.
The algorithm is the procedures/functions used to solve the problems. To reuse the existing class/objects and utilitiesis the best choice. The simplicity is the major concern on choosing the appropriate algorithm. The time/space/cost trade-off should be always kept in mind when picking an algorithm.
The proficient in the specific language and all of the language features are very important for the designer to implement the software in the straight forward top-down design fashion.
The Programming basic concepts:
===============================================================================
The essential elements to master a specific programming language.
1. Overview of C/C++/VB/JAVA
The origin of C/C++/VB/JAVA
Functional language
Compiler versus Interpreter
2. Language expressions
Declaration statement
The five basic primitive data types
Modify the basic data types
Identifier & variable
Storage class type specifier
3. Program control statements
Boolean expression
Selection statement
Iteration statement
Expression statement
Compound statement
Control statement
Input/output statement
4. Arrays and strings
Row major
Array name
Pointer
String, char and NULL
ASCII code and collating sequence
5. Pointer
Pointer variable
Pointer operators
Pointer expression
Pointer and arrays
Dynamic memory allocation
6. Functions/methods/procedures
General form of a function
Scope rules of functions
Function arguments
Function returned value
Function prototype
Returning pointer
Recursive versus iteration
Function of type void
Call by reference and call by value
Library and header files
7. Structure, union, enumeration and user-defined data type
Structure
Structure with self-referenced pointer
Array of structures
Passing structures to functions
Arrays, pointers and structures inside a structure
Bit-fields
Use structure to formulate a link list
Enumerations
Unions
8. Console I/O
Reading and writing characters, intergers, and floating numbers
get, gets, put, puts
scanf, printf, sscanf, and sprintf
9. File I/O
Unix file system i/o system calls
creat(), open(), read(), write(), lseek() and close()
File pointer and its structure
fopen(), fread(), fseek(), fread(), fwrite(), fscanf(), and fprintf()
10. The preprocessor and comments
#define
#include
#ifdef
/* ...... */
11. Linking, library, header files
Standard C library
Specific graphics, math, io,.. libraries
Application specific library
12. System functions
I/O functions
Math functions
Time, Date function
File system functions
Dynamic memory allocation functions
String functions
Graphics and screen functions
13. Application domain knowledge and algorithms
Top-down design versus bottom-up implementation
Divide and conquer
Dynamic programming
Greedy method
Branch and bound
Heristic optimization
Algorithm big-O notation and complexity
Sorting
exchange
selection
insertion
Searching
sequential
binary
hashing
14. Data structure
Data representations
Abstracted data type
Operands and its operations
Array
Link list
Binary trees
Queue
15.C++
Data abstraction
Class and object
Function overloading
Operator overloading
Inheritance and polymorphism
16. Application problems
Sequential search
Binary search
Heap sort
Eight queens problem
Four color map problem
Maze problem
Depth-first search
Breadth-first search
Heuristics search to goal problems
Hill-climbing search
Least cost search
Stack
Sparse array
Hashing
Inventory control system
Dictionay lookup system
Telephone directory system
Registration system
Presales analysis system
Stock market predict & suggestion system
Database management kernal system
Scanner
Parser
Convert NFA to DFA
Thinning in GIS grid
Seven parameter coordinate systems transformation
Bivariable coordinate transformation
Least square fit method
Solve linear equations
Linear programming simplex method
Graphics user interface design
Client/server model applications
Help facilities
C++/OOP main concepts:
===============================================================================
1. The differences between procedural and object-oriented programming
2. Four characteristics of an OOP
3. What is an object
4. Abstract data type
5. Encapsulation
6. Methods and messages
7. Inheritance
8. Polymorphism
The expression of an algorithm should model the application domain
that it supports.
In functional decomposition (FD) or procedural programming, we design
a set of data structures followed by functions and procedures to process
the data. It emphasizes the functions rather than the data.
OOP: express the program in ways that model how people perceive the world.
Four fundamental characteristics of OOP:
1. Abstraction defines new data types
2. Encapsulation designs a data type's representation and its behavior in
on encapsulated entity.
3. Inheritance derives a new data type from an existing one.
4. Polymorphism customizes the behavior of a derived data type.
OOP defines an ADT by encapsulating its implementation and interface into
a class. The programmer instantiates objects of classes and send messages
to the objects by using the class's methods.
An object is an instance of a data type. An instance of class.
an object is the variables you declare in the program.
ADT includes the data types representation and behavior, but not
its implementation details. (What instead of how)
A programmer encapsulates the data representation and behavior of an ADT
into a class, giving its own implementation and interface.
An encapsulated design hides its implementation from the class user
and reveals its interface.
The interface which is visible to the user of the class consists of the
public member functions. The class user reads and modifies values in the
data representation by calling the public memeber functions.
C++ provides the tools for you to do a proper job, but nothing in the
language enforces good design.
Method is another name for C++ public functions. Methods maybe constructors,
destructors,procedures and overloaded operators.
They define the class interface.
A message is the invocation of method, which in C++ is the same thing as
calling the public member function.
There are functional methods, data type methods,and implicit
conversion methods.
The derived class inherits the data representation and behavior of the base
class except where the derived class modifies the behavior by overloading
member functions. The derived class adds behaviors that is unique to its
own purpose.
If the base class is an abstract base class, then the program may not
instantiate objects of the base class.
Inheritance is the foundation of most OOD. The C++ inheritance mechanism
lets you build an orderly hierachy of classes. When several of your ADT
have characteristcis in common, you can design their commonalities into
a single base class and seperate their unique characteristics into unique
derived classes. That is the purpose of inheritance.
The effectiveness of a programming language can be measured in its
abilities to model the problem domain that it supports.
Polymorphism exists when a derived class customizes the behavior of the
base class to meet the requirements of the derived class.
A C++ base class uses the virtual memeber function to specify that
overridding member functions in derived classes have polymorphic behavior
with respect to that method.
C++ has the facility to support the basics of oop while permitting the
programmer to use the traditional FD/PP where it seems appropriate.
C++ encourages this approach.
Trust me and be patient. Everything will eventually become clear.
Stick with it and you will be rewarded.
p5
1. The iostream class
#include
main()
{
char name[20];
cout<<"Enter a name";
cin>>name;
cout<<"Your name is "<
int amount=123;
main()
{
int amount=456;
cout<<::amount<<' '<
}
8. Anonymous unions
union {
int a;
float b;
}
b=12.34;
cout << b;
cin>>a;
9. Unnamed function parameters
int func(int x, int)
{
return x+x;
}
10. constrcutors for intrnsic types
int size(12);
p41
1. The new and delete operators
#include
struct Date {
int month;
int day;
int year;
};
Date *birthday=new Date;
delete birthday;
int *birthday=new int[3];
int *array = new int[size];
2. Exhausted free store
set_new_handler(all-gone);
p59
1. overloading to change functionality
C++ allows you to give more thanone function the same name with different
number, type, position of parameters.
2. overloading to accomodate different data formats
void display_time(const struct tm *tim);
void display_time(time_t *tim);
p65
1. structures as data types
In C++, a structure is its own data type and can be known by its own
name without the struct keyword
struct Date { int month, day, year;}
Date birthday;
2. structures with function members
struct Date
{
intmonth, day, year;
void display();
}
void Date::display()
{
static char *mon[]={"Jan","Feb",..."Dec"};
cout<