0% found this document useful (0 votes)
36 views

Scientific Programming Language: Miss Faryal Batool BS Mathematics 3 Semester

The document discusses different types of programming languages and tools used in software development including assemblers, compilers, interpreters, and linkers. It provides details on each tool's functionality, how they translate code between low and high-level languages, and their relative speeds of execution. The document also covers problem representation techniques like algorithms and flowcharts, and provides examples of each.

Uploaded by

rimsha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Scientific Programming Language: Miss Faryal Batool BS Mathematics 3 Semester

The document discusses different types of programming languages and tools used in software development including assemblers, compilers, interpreters, and linkers. It provides details on each tool's functionality, how they translate code between low and high-level languages, and their relative speeds of execution. The document also covers problem representation techniques like algorithms and flowcharts, and provides examples of each.

Uploaded by

rimsha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Scientific programming

language
Lecture 2
Miss faryal batool
BS mathematics
3rd semester
Assembler

• A computer will not understand any program written in a


language, other than its machine language.
• The programs written in other languages must be translated into
the machine language. Such translation is performed with the help
of software.
• A program which translates an assembly language program into a
machine language program is called an assembler.
Compiler

• It is a program which translates a high level language program into


a machine language program.
• A compiler is more intelligent than an assembler. It checks all
kinds of limits, ranges, errors etc.
• But its program run time is more and occupies a larger part of the
memory. It has slow speed.
• Because a compiler goes through the entire program and then
translates the entire program into machine codes.
Interpreter

• An interpreter is a program which translates statements of a


program into machine code.
• It translates only one statement of the program at a time.
• It reads only one statement of program, translates it and executes
it. Then it reads the next statement of the program again
translates it and executes it.
• In this way it proceeds further till all the statements are
translated and executed. On the other hand, a compiler goes
through the entire program and then translates the entire program
into machine codes. A compiler is 5 to 25 times faster than an
interpreter.
Linker

• In high level languages, some built in header files or libraries are


stored.
• These libraries are predefined and these contain basic functions
which are essential for executing the program.
• These functions are linked to the libraries by a program called
Linker.
• If linker does not find a library of a function then it informs to
compiler and then compiler generates an error.
• The compiler automatically invokes the linker as the last step in
compiling a program.
Concept of programming
High level language Low level language
One can write applications that are portable Languages those are extremely close to
across various platforms and is independent of machine language.
any architecture.

Easy to understand & User friendly Not easy to understand

Used to write code for developing software. Used for developing operating system or codes
for micro-controllers.

Low to process due to multiple dependent Fast to process due to closeness with hardware
layers among hardware and software. and they don’t need any conversions.

Flexible to read, edit, debug, understand Low Level Languages are not so easy to handle.
Problem representation techniques

• Problems can be represented in two ways:


• Write Algorithm (Pseudocode: A semi programming language used
to describes steps )
• Make Flow Charts (Diagrams)
Algorithm

“An effective procedure for solving a class of problems in a finite


number of steps.”
• It is an recipe that describes exact steps needed for computers to
solve a problem or to reach a goal.
• Every algorithm should have the following 5 characteristic feature:
1. Input
2. Output
3. Definiteness
4. Effectiveness
5. Termination
Example of algorithm
Flow chart

• The flowchart is a means of visually presenting the flow of control


through an information processing systems, the operations
performed within the system and the sequence in which they are
performed.
• It is a graphic representation of how a process works, showing, at a
minimum, the sequence of steps.
• Flowcharts are generally drawn in the early stages of formulating
computer solutions.
How to draw flow chart

Flowcharts are usually drawn using some standard symbols;


Some standard symbols, which are frequently required for
flowcharting many computer programs are shown below,-
Further elaboration

• Rounded box
Use it to represent an event which occurs automatically.
• Rectangle or box
Use it to represent an event which is controlled within the
process.
Typically this will be a step or action which is taken.
• Diamond
Use it to represent a decision point in the process.
• Circle
Use it to represent a point at which the flowchart connects with
another process.
Advantages of flow chart

• Communication: Flowcharts are better way of communicating the


logic of a system
• Effective analysis: Problem can be analyzed in more effective
way.
• Proper documentation: Flowcharts serve as a good program
documentation
• Efficient Coding: Flowcharts act as a guide or blueprint during the
systems analysis and program development phase.
Contd:

• Proper Debugging: Flowchart helps in debugging process.


• Efficient Program Maintenance: The maintenance of operating
program becomes easy with the help of flowchart.
Flow chart of largest two numbers
To find a number even or odd

You might also like