Documente Academic
Documente Profesional
Documente Cultură
EPT 162
Computer Programming
Monday
EXPECTATION
YOUR COMMITMENT TOWARDS STUDY
YOU ARE UNIV STUDENTS
FULL ATTENDANCE
DO A LOT OF INDEPENDENCE STUDY
SELF
LEARNING
SEARCH
READING
Instructor
INFORMATION
Room: MPU 7
Room: MPU8
Evaluation
General Information
Main Objective:
Students
Exams:
References
Today Outline
Computer Fundamentals
Computer organization
and hardware
Computer software
Programming Languages
Machine
language
Assembly language
High-level language
7
Computer Fundamentals
Memory
Processing Unit (CPU)
Input Device
Output Device
Secondary Memory Device
Central
Components of a Computer
1-10
1-11
12
Computer Hardware
CPU
Control Unit
Input Device
Arithmetic and
Logic Unit
Register
Output Device
Main Memory
Secondary Memory
13
Main Memory
14
Main Memory
15
Read
16
Secondary Memory
Main memory is only used during
processing following certain instructions
Permanent information is NOT stored in
main memory but is stored in secondary
memory
E.g.
E.g.
1-17
18
Input/Output Devices
1-19
20
Software
Software
System
software
Application software
Software
Program
Programming Languages
22
Language
Language
High-Level Language
Assembly
24
Machine Language
1-26
Assembly Language
Assembly Language
Strings of 0s and 1s are replaced into
instructions which resemble English
language to represent computer operation
element
Easier to understand and write
LOAD
rate
E.g.
MULT
STOR
hour
wages
27
28
High-Level Language
Algorithms
29
30
Algorithm-Basic symbols in a
flowchart
Algorithms
Flowchart: visual-form of an algorithm
E.g.
Start/End
Begin
Flow
direction
Process
Data
Connector
Input/Output
Process 1
Decision
Process 2
Decision
End
31
32
TRY THIS!!!
Flowchart
Pseudo code
Begin
Begin
Input A and B
Calculate A + B
Print result of SUM
End
Input
A,B
Calculate
A+ B
Print SUM
End
33
Sequence Structure
Control Structure
34
Sequence
structure
Selection structure
Repetition structure
Flowchart
Read num1, num2
Calculate total=num1+num2
Print total
total = num1+num2
print total
35
36
Selection Structure
if structure is a single-entry/single-exit
structure
If students grade is greater than or equal to 60
Print Pass
grade >= 60
true
print Pass
false
37
Repetition Structure
than or equal to 60
Print Pass
else
Print Fail
false
print Fail
grade >= 60
38
true
print Pass
39
40
10
true
product <= 1000
product = 2 * product
false
While product is less than or equal 1000
calculate product=2 * product
41
42
Entering, Translating,
and Running
a High-Level
Language Program
1-44
11
Any Question?
#include <stdio.h>
int main(void)
{
int A, B, SUM;
printf (input first integer \n);
scanf (%d, &A)
printf (input second integer \n);
scanf (%d, &B)
OUTPUT
SUM = A + B;
45
46
Reference
EKT 120 notes, School of Computer &
Communication, UNIMAP.
Hanly & Koffman, C Program Design for
Engineers. Addison Wesley, 2nd Edition,
2001.
47
12