MEE 505 - Lesson-01
MEE 505 - Lesson-01
APPLIED COMPUTER
PROGRAMMING
1
COURSE CONTENT
2
REFERENCES
Byron S. GOTFRIED: Theory and problems of
Programming with Basic, 3rd Edition, Tata
McGraw-Hill, 2004.
Beginner's Programming Tutorial in Qbasic,
available @http://www.geocities.com
/progsharehouse/qbtutor
I.M. Smith: Programming in FORTRAN 90, John
Exam: 70%
Office: 8G29 4
INTRODUCTION
MEANING OF THE KEYWORD
Computer: They are basically electronic devices
that can transmit, store and
manipulate information or data.
5
INTRODUCTION CONTD.
TYPES OF PROGRAMMING LANGUAGES
Machine Language
It is the only language the computer can
understand.
Assembly Language
is a programming language that can be
Used to directly tell the computer what to
Do. It is like the machine code that the
computer can understand.
6
INTRODUCTION CONTD.
High-level language
Is a programming language that enables a
programmer to write programs that are
more or less independent of a particular of
computer. They are high-level because
they are closer to human language and
further from machine languages.
Low-level language
Is a language close to machine languages,
e.g. assembly language.
7
INTRODUCTION CONTD.
TYPES OF PROGRAMES
BASIC PROGRAM
FORTRAN
PYTHON
JAVA
RUBY
C++
COBOL
**EXCEL
etc.
8
INTRODUCTION CONTD.
Basic:
It is a full beginner’s All-purpose
Symbolic Instruction Code. Suitable
for many scientific and
engineering applications
Fortran:
It is a general-purpose, compiled
imperative programming language
that is suitable for numeric
computation and scientific computing,
and also for engineering applications
9
INTRODUCTION CONTD.
Python
Is an interpreted high-level general-
purpose programming language, it can
be used for web development,
operating systems, mobile application
development, etc.
Pascal:
It is a high-level programming
language used for development in the
Apple Lisa. 10
INTRODUCTION CONTD.
Java:
It a general –purpose, high level,
programming language that is designed to
have few implementation dependencies. It
for internet-based applications. It is used to
develop desktop and mobile Applications
and for big data processing
Ruby:
it is an interpreted high-level, general-
purpose programming language , used for
building web applications, data analysis.
11
INTRODUCTION CONTD.
TYPES OF DATA
Numerical
Character-type
Names
Addresses, etc.
HOW COMPUTER WORKS
Input data: information enter into the computer
Processed data: input data processed to produce
desired results
Output data: The results printed out either on a
sheet or display on a screen (monitor)
12
BASIC PROGRAMMING
ACRONYM BASIC:
B -Beginner’s
A-All-purpose
S- Symbolic
I- Instruction
C- Code
13
STRUCTURE OF A BASIC PROGRAM
Every statement must appear on separate line
A statement cannot exceed one line
Each line must begin with a positive integer
(Line number)
Successive statement must have increasing
statement numbers
Each statement number must be followed by a
BASIC keyword ( This tells instruction to be
carried out)
14
NOTE
REM/’ - Remarks, non executable
statement
LET - To assign
END - Indicates logical end of the
program (it stops the program at
that line)
STOP - May be used to terminate
program execution and return to
command level
BLANK SPACE – May be inserted to
improve the readability of a
statement
15
COMMON MATHEMATICAL EXPRESSIONS
Sign Meaning
* - Multiplication (Asterisk)
/ - Division (Slash)
^ - Exponential (Upward-pointing
Arrow)
+ - Addition (plus sign0
- - Subtraction (minus sign)
( ) Bracket (Multiplication)
16
HIERARCHY OF OPERATIONS
Exponentiation
Multiplication and Division
(Multiplication does not necessarily precede division)
Addition and subtraction
( Addition does not necessarily precede division)
IN CASE OF PARENTHESES
( )
The operations within the innermost pairs of
parentheses is first performed.
17
SOME LIBRARY FUNCTIONS BASIC PROGRAM
2
b b 4ac
X 1
2a
2
b b 4ac
X 2
2a
20
10 REM Program to calculate the roots of a quadratic
20 ‘ equation
30 REM a, b and c are data to be specified
40 REM Input the variables
40INPUT A
50 INPUT B
60INPUT C
70 LET X1 =( -B+ SQR(B^2 – 4*A*C)/2*A)
80 LET X2 =( -B- SQR(B^2 – 4*A*C)/2*A)
90 REM PRINT RESULT ON THE SCREEN
70PRINT A, B, C, X1, X2
80 END
21
22