Professional Documents
Culture Documents
Introduction
1 / 16
Outline
Introduction to Programming Overview of Computer Programming Overview of FORTRAN Program Algorithmic Approach and Flowcharting Examples Example-1 Example-2 Example-3 Example-4 Example-5
Introduction
2 / 16
Introduction to Programming
Programming
Computer programming (often shortened to programming or coding) is the process of designing, writing, testing, debugging / troubleshooting, and maintaining the source code of computer programs. This source code is written in a programming language. The purpose of programming is to create a program that exhibits a certain desired behaviour. The process of writing source code often requires expertise in many dierent subjects, including knowledge of the application domain, specialized algorithms and formal logic.
Introduction
3 / 16
Introduction to Programming
History
Introduction
4 / 16
Introduction to Programming
FORTRAN
Fortran (Formula Translating System) is a general-purpose, procedural, imperative programming language that is especially suited to numeric computation and scientic computing. Originally developed by IBM in the 1950s for scientic and engineering applications. Fortran came to dominate this area of programming early on and has been in continual use for over half a century in computationally intensive areas such as: numerical weather prediction, nite element analysis, computational uid dynamics, computational physics and chemistry. It was one of the most popular languages in the area of high-performance computing and is the language used for programs that benchmark and rank the worlds fastest supercomputers.
Dr. Tolga PIRASACI (Gazi University) Introduction 5 / 16
Introduction to Programming
History
In late 1953, John W. Backus submitted a proposal to his superiors at IBM to develop a more practical alternative to ASSEMBLY language for programming their IBM 704 mainframe computer. A draft specication for The IBM Mathematical Formula Translating System was completed by mid-1954. The rst manual for FORTRAN appeared in October 1956, with the rst FORTRAN compiler delivered in April 1957. This was an optimizing compiler, because customers were reluctant to use a high-level programming language unless its compiler could generate code whose performance was comparable to that of hand-coded assembly language.
Introduction
6 / 16
Introduction to Programming
History
The language was widely adopted by scientists for writing numerically intensive programs, which encouraged compiler writers to produce compilers that could generate faster and more ecient code. The inclusion of a complex number data type in the language made Fortran especially suited to technical applications such as electrical engineering. By 1960, versions of FORTRAN were available for the IBM 709, 650, 1620, and 7090 computers. Signicantly, the increasing popularity of FORTRAN spurred competing computer manufacturers to provide FORTRAN compilers for their machines, so that by 1963 over 40 FORTRAN compilers existed. For these reasons, FORTRAN is considered to be the rst widely used programming language supported across a variety of computer architectures.
Introduction
7 / 16
Introduction to Programming
FORTRAN Versions
Fortran 0 Fortran I Fortran II Fortran III Fortran IV Fortran 77 Fortran 90 Fortran 95 Fortran 2003 Fortran 2008
Introduction
8 / 16
Algorithm
Introduction
9 / 16
Flowchart
Introduction
10 / 16
Flowchart Symbols
Beginning or end of program Input data from le Input data from keyboard Computation or mathematical operation
Indicate a decision
Output to a le
Output to screen
Examples
Example-1
Example-1
Introduction
12 / 16
Examples
Example-2
Example-2
Introduction
13 / 16
Examples
Example-3
Example-3
Write an algorithm and draw a owchart to compute the function F below for an unknown number of set of data. The last data record has the value 999 and denes the end of data. 2 x +1 x 0 x 0<x <1 F = x x 1
Introduction
14 / 16
Examples
Example-4
Example-4
Introduction
15 / 16
Examples
Example-5
Example-5
Input nine numbers one at time and locate each as an element of doubly subscripted variable Xij . Each subscript has the range from 1 to 3.
Introduction
16 / 16