0% found this document useful (0 votes)
24 views22 pages

MEE 505 - Lesson-01

The document outlines a course on Applied Computer Programming, covering various programming languages such as BASIC, FORTRAN, and Python, and their applications in solving mathematical and engineering problems. It includes information on programming concepts, types of programming languages, and examples of basic programming structures and functions. Additionally, it provides grading criteria, references, and an introduction to fundamental programming principles.

Uploaded by

Taiwo Subair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views22 pages

MEE 505 - Lesson-01

The document outlines a course on Applied Computer Programming, covering various programming languages such as BASIC, FORTRAN, and Python, and their applications in solving mathematical and engineering problems. It includes information on programming concepts, types of programming languages, and examples of basic programming structures and functions. Additionally, it provides grading criteria, references, and an introduction to fundamental programming principles.

Uploaded by

Taiwo Subair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 22

MEE 505

APPLIED COMPUTER
PROGRAMMING

1
COURSE CONTENT

Development of Programming Languages:


BASIC, FORTRAN, PHYTON , EXCEL, ALGOL,
COBOL, etc.
Application of computers to solving
Numerical , Statistical and a variety of
Mathematical/ Engineering problems.
Simulation and optimization techniques.

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

Willey and Sons Ltd.,1995.


 etc.
3
GRADING
C/A : 30%

Exam: 70%

Venue: Graphics Room

Lecturer: I.K. Adegun

Office: 8G29 4
INTRODUCTION
MEANING OF THE KEYWORD
Computer: They are basically electronic devices
that can transmit, store and
manipulate information or data.

Program: Is a set of instructions to execute or


process a particular set of data in
order to solve a particular problem

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

Function Application Description


ABS LET Y = ABS(X) Calculate the absolute value of x; ylxl.

ATN LET Y = ATN(X) Calculate the arctangent of x; y = arctan(x).


COS LET Y = COS(X) Calculate the cosine of x; y=cos (x), x in radians.
COT LET Y = COT(X) Calculate the cotangent of x; y=cot (x), x in radians.
EXP LET Y = EXP(X) Raise e to the power; y=ex
INT LET Y = INT(X) Assign to y the largest integer that algebraically does
not exceed x
LOG LET Y = LOG(X) Calculate the natural logarithm of x; y=loge x
SGN LET Y = SGN(X) Determine the sign of x( y= +1 if x is positive, y=0 if
x=0, y=-1 if x is negative
SIN LET Y = SIN(X) Calculate the sine of x; y = sin(x), x in radians
SQR LET Y = SQR(X) Calculate the square root of x; y= x0.5 , x>0
TAB PRINT TAB(N); x To print the value of x at column N, left column is 0
TAN LET Y =TAN(X) Calculate the tangent of x; y=tan(x), x in radians.
18
EXAMPLES OF SIMPLE BASIC PROGRAM
Basic Program to calculate area of a circle.
A  r 2

10 REM PROGRAM TO CALCULATE AREA OF A CIRCLE


20 REM r is radius, Pi= 3.142
30 REM Calculate the Area
40INPUT r
50LET A= 3.142 * (r^2)
60REM PRINT RESULT ON THE SCREEN
70PRINT A
80 END 19
The Roots of Quadratic Equation
Y  ax 2  bx  c

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

You might also like