PROGRAMMING ALGORITHM 2
PROGRAMMING ALGORITHM 2
ALGORITHM
CSC 237
BY
DR WALTER IBE
REVIEW
Problem Analysis
Design
Coding
The Compilation Process: The process of compilation involves reading the source
code, checking for errors in the source code and converting it to an executable
format(machine code) if no error is detected
The Object Code: The object code is the result of the compilation process and it is
also called the target code. The object code is dependent on the programming
language chosen.
Eg. JAVA (bytecode), Fortran (executable statement of the target machine), BASIC
(target machine language) etc
The Output: The last stage is for the computer to give the result. The computer
executes the object code in order to present the desired output. It is important to note
that a valid or desired output might not be given if the logic of the program is not
Principles of a Good Programming
Style
The following represent the major considerations in
writing good programs:-
Naming Conventions:
File Naming and Organization:
Formatting and Indentation:
Comments and Documentation:
Classes:
Functions:
Using STL:
Pointers and References:
Minimizing Bugs by Testing:
Quality of a good programming
style
1) Naming Conventions:
It is very important to give meaningful names to all your constructs. A
name like get_Height() or get_avg_height()gives us much more
information than ctunde()
Class name should start with an uppercase letter, e.g. class AddPrime
Variable name should start with a lowercase letter, e.g. firstQuad;
Functions should be named similar to variables.
Model
the real world entities and relationship
between them using its key components like
Object and Classes
Encapsulation
Inheritance
Polymorphism
Object-oriented Modeling(OOM)
Is a common approach to modeling
programs by using object-oriented paradigm
throughout the entire development life
cycle.
This is the main technique used in modern
software engineering.
The OOM typically divides programming life
cycle into two aspects:
- Modeling of the dynamic behaviors like
processes and use cases
- Modeling the static structures like classes
and components
Advantages of using OOM
Efficient
and effective communications
between the system and the real world