Introduction to programming
Computer Programming 1
Program: Intermediate Diploma in Programming and Computer Science
Course Code: APPC121
Amira Alotaibi
College: Applied College
Institution: University Of Jeddah
Programming Languages
❑ Programs
❑ Why lean programming
❑ The role of programmer
❑ Machine Language
❑ Assembly Language
❑ High-Level Language
❑ Popular High-Level Languages
❑ Interpreting/Compiling Source Code
❑ Interpreting Source Code
❑ Compiling Source Code
Programs
• Computer programs (known as software), are instructions to the computer.
• You tell a computer what to do through programs.
• Without programs, a computer is an empty machine.
• Computers do not understand human languages, so you need to use computer languages to
communicate with them.
• Programs are written using programming languages.
Why learn programming?
• Career opportunities: Software development, data analysis, artificial intelligence, cybersecurity,
etc.
• Problem-Solving skills: Develop logical thinking and creativity.
• Impact: Create apps, games, websites, and automate tasks.
The role of a programmer
• The role of a programmer:
➢ Write, test, and maintain code.
➢ Debug errors and optimize software performance.
➢ Collaborate with teams to build software systems
• Skills needed: Logical thinking, attention to detail, patience
Programming Languages
- Machine Language
• Machine language is a set of primitive instructions built into every
computer.
• The instructions are in the form of binary code, so you have to enter
binary codes for various instructions.
• Program with native machine language is a tedious process.
• Moreover, the programs are highly difficult to read and modify.
• For example, to add two numbers, you might write an instruction in
binary like this:
1101101010011010
Programming Languages
- Assembly Language
• Assembly languages were developed to make programming easy.
• Since the computer cannot understand assembly language, however,
a program called assembler is used to convert assembly language
programs into machine code.
• Writing code in assembly language is easier than in machine
language. However, it is still tedious to write code in assembly
language.
• For example, to add two numbers, you might write an instruction in
assembly code like this:
ADD 2, 3, result
Programming Languages
- High-Level Language
• The high-level languages are English-like and easy to learn and
program.
• Since the computer cannot understand high-level languages,
however, a program called interpreter, or compiler is used to convert
high-level language programs into machine code.
• For example, the following is a high-level language statement
(instruction) that computes the area of a circle with radius 5:
area = 5 * 5 * 3.1415
Popular High-Level Languages
Interpreting/Compiling Source Code
• The instructions in a high-level programming language are called
statements.
• A program written in a high-level language is called a source program or
source code.
• Because a computer cannot understand a source program, a source
program must be translated into machine code for execution.
• The translation can be done using another programming tool called an
interpreter or a compiler.
Interpreting Source Code
• An interpreter reads one statement from the source code, translates it to
the machine code or virtual machine code, and then executes it right
away.
• Note that a statement from the source code may be translated into
several machine instructions.
Compiling Source Code
A compiler translates the entire source code into a machine code file, and
the machine-code file is then executed.
Operating Systems
• The operating system (OS) is a program that
manages and controls a computer’s activities.
• You are probably using Windows 10, Linux, or
macOS.
• Windows is currently the most popular PC
operating system.
• Application programs- such as an Internet
browser and a word processor- cannot run
without an operating system.