Welcome: Computer Programming-I
Welcome: Computer Programming-I
CSC 201
COMPUTER
PROGRAMMING-I
Lecturer
Musa MUHAMMED, PhD
Class Assistant
Mr.Yussuf ABBAS
COURSE SYLLABUS
COMPUTER PROGRAMMING-I
2
COURSE CONTENTS
3
ATTENDANCE
Compulsory
4
EVALUATION POLICY
All grade levels evaluate by 100 point matters, final grade will be
assigned according to a weighted average of the scores CA (40%
of final grade) and final (60% of final grade) exam results.
5
OUTLINE OF COURSE TOPICS
6
LIST OF THE COURSES
7
8
Lecture 1
Introduction to
Programming Languages
Goals
Comprised of 1s and 0s
The “native” language of a computer
Difficult to program – one misplaced 1 or 0 will cause the program to
fail.
Example of code:
1110100010101 111010101110
10111010110100 10100011110111
Assembly Languages
Translating to Basic:
INPUT PoundPrice
LET DollarPrice = 1.62 * PoundPrice
PRINT DollarPrice
END
Types of Data
Numeric Data
Integer data, I.e., whole numbers, 10 25 -45
0
Floating point data – have a decimal point
23.0, -5.0
Character data (alphanumeric)
Allthe characters you can type at the keyboard
Letters & numbers not used in calculations
Boolean data
TRUE/FALSE
Data Processing and Output
Write DollarPrice
Output the value in DollarPrice to the
monitor.
Assignment Operations
1. Parenthesis
2. Exponentiation
3. Multiplication/Division
4. Addition/Subtraction
Hierarchy of Operations Example
3 * (6 + 2) / 12 – (7 – 5) ^ 2 * 3 ( ) first
= 3 * 8 / 12 – 2 ^ 2 * 3 ^ next
= 3 * 8 / 12 – 4 * 3 Mult/Div (L to R)
= 24 / 12 – 4 * 3 Mult/Div (L to R)
= 2 – 12 Add/Subtr
= -10
Data Output
Send information from the program to the screen,
or printer, or disk file.
Write DollarPrice
The computer displays the value of the variable
DollarPrice to the screen and the cursor goes
to the next line.
Data Output
Write “The price in Dollars is”,
DollarPrice