Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Engineering Algorithms, Compilers, & Lifecycle.

Similar presentations


Presentation on theme: "Software Engineering Algorithms, Compilers, & Lifecycle."— Presentation transcript:

1 Software Engineering Algorithms, Compilers, & Lifecycle

2 Programming Languages u Common programming languages include … C C++ Java Pascal Visual Basic FORTRAN COBOL Lisp Scheme Ada u These high-level languages  Resemble human languages  Are designed to be easy to read and write  Use more complicated instructions than the CPU can follow  Must be translated to zeros and ones for the CPU to execute a program

3 Low-level Languages u An assembly language command such as ADD X Y Z might mean add the values found at x and y in memory, and store the result in location z. u Assembly language must be translated to machine language (zeros and ones) 0110 1001 1010 1011 u The CPU can execute machine language instructions

4 Compilers u Translate high-level language to machine language  Source code  the original program in a high level language  Object code  the translated version in machine language

5 Linkers u Some programs we use are already compiled  Their object code is available for us to use  Input and output routines u 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

6 From Source Code to Executable Program #include using namespace std; int main() { cout << "Hello World!" << endl; return 0; } #include using namespace std; int main() { cout << "Hello World!" << endl; return 0; } compiler linker 1001010100010 1010010101001 0010101001010 0101001001001 0100101010101 0010010100100 1001010010100 1010000100100 1001 library 1001010100010 1010010101001 0010101001010 0101001001001 0100101010101 0010010100100 1001010010100 1010000100100 1001 object file 0100101010010 1001010010010 0101001010101 0100100101001 0010010100101 0010100101010 1010100100100 1000100100100 1001 executable file

7 u Algorithm  A sequence of precise instructions which leads to a solution u Program  An algorithm expressed in a language the computer can understand Programming & Problem Solving

8 Program Design u Programming is a creative process  No complete set of rules for creating a program u Design process for CS-201  Problem Solving Phase  Produce an algorithm that solves the problem  Implementation & Testing Phase  Translate into a valid, functioning program

9 Problem Solving Phase u Be certain the task is completely specified  What is the input?  What information is in the output?  How is the output organized? u Develop the algorithm before implementation  Experience shows this saves time in getting your program to run  Test the algorithm for correctness

10 Implementation & Testing Phase u Translate the algorithm into a programming language  Easier as you gain experience with the language u Compile the source code  The compiler identifies violations of the programming language's grammar  These are known as syntax errors u Run the program on sample data  Verify correctness of results  If you made mistakes in your algorithm design, or in your translation to the programming language, you'll see errors  These are known as logic errors u Modify the algorithm and/or program and repeat


Download ppt "Software Engineering Algorithms, Compilers, & Lifecycle."

Similar presentations


Ads by Google