0% found this document useful (0 votes)
5 views

Week01 Intro to Programming Language 2025

This document provides an overview of computers and programming languages, highlighting their definitions, types, and the importance of programming. It discusses the generations of programming languages, the process of converting high-level programs into executable code, and various language translators. Additionally, it introduces Integrated Development Environments (IDEs) used for programming applications.

Uploaded by

beastofficial51
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Week01 Intro to Programming Language 2025

This document provides an overview of computers and programming languages, highlighting their definitions, types, and the importance of programming. It discusses the generations of programming languages, the process of converting high-level programs into executable code, and various language translators. Additionally, it introduces Integrated Development Environments (IDEs) used for programming applications.

Uploaded by

beastofficial51
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

CSC099 FOUNDATION COMPUTING II

Introduction to Computer and


Programming Language
WEEK 1
LESSON OUTCOMES
Upon completion of this chapter, students should be able to:
• Provide an overview of computers and programming languages.
• Explain the importance of programming languages.
• Differentiate between the generations of programming languages.
• Compare different types of language translators.
• Describe the process of converting a high-level program into
executable code.
• Identify various Integrated Development Environments (IDEs).
Introduction to Computer
Definition: Computer and Programming Language
• Computer – an electronic devices consist of hardware and
software and perform tasks and produce the output
• Computer – is a device that can perform computation and
logical decisions billion times faster than human being can.
• Programming Language – language for computer consist
of a vocabulary and a set of rules that can be understood by
the computer
Introduction to Computer
Types of Computer
• Individuals • Organizations
• Desktop : PC, iMac • Supercomputers
• Personal Digital Assistant • Mainframes
(PDA) • Servers
• Laptop • Minicomputers
Introduction to Computer
Encoding Scheme
• Each printable and non-printable character is represented by unique
number in memory.
• Encoding – method to encode character to unique number

• ASCII (American Standard Code for Information Interchange)


• Originally, ASCII used 7 bits equals one character; 128 characters; used by
minicomputers and personal computers.
• After that, ASCII was extended to be 8 bits equals one character; 256 characters.
• EBCDIC (Extended Binary Coded Decimal Interchange Code)
• 8 bits equals one character; 256 characters; used by mainframe computers and
IBM.
• Unicode
• 16 bits (2 bytes ) equals one character; 65536 characters; used for foreign language
symbols.
Encoding
Schemes:
Example
Introduction to Computer
Definition of a Programming Language
• A set of rules, words and symbols are used to write a
computer program – telling a computer what to do.
• The source codes (program) are compiled and the
executable files (*.exe) are produced.
program1
Error free

Compiled Executable
Programmer file (*.exe)
writes program & debug
Introduction to Computer
Understanding Software Programming
• Some tasks are complex
• Requires creative thought
• Requires human touch
• Some tasks are candidates for
automation
• Works with electronic information
• Repetitive
• Follows a series of clear steps
Introduction to Computer
The importance of Programming
• A career in programming offers
• Plentiful jobs
• Strong salaries
• Telecommuting is often easy to arrange
• Computer programs exist for many
tasks
• Programming necessary when no
existing software for task
Introduction to Computer
The importance of Programming
Add features
that support
personal
needs

Successfully Create
complete miniprograms
projects (macros)
Basic
knowledge of
programming

Create custom Add custom


applications commands
Programming
Introduction
Language:
to Computer
The Type

•Low-level: Written mainly in binary


or machine code (0’s/1’s)
•High-level: closer to human language
Programming Language: The Generation
• Machine language
• Assembly language
• High Level language

program → machine language


Compiler
machine language → program
Computers understand
People understand
binary(11011)
‘program’
Programming Language: The History
Computer
language
evolution

The only language understood by a computer is machine language

Machine Language Assembly Language

COBOL BASIC Fortran Smalltalk Ada

Visual Basic C and C++ Pascal Java


Programming Language: Machine Language
• Binary number codes understood by a specific CPU.
• Lowest level of language
• Represent data and program instructions as 1s and 0s
• The only language that computer directly understand
• (Do not require translator)
• Not convenient to read and use. Example:
To calculate wages = rates * hours in
• First generation language machine language:
• Machine - dependent 100100 010001 //Load
100110 010010 //Multiply
100010 010011 //Store
Programming Language: Assembly Language
• Second generation language
• Developed to replace 1s and 0s use in machine language.
• Use mnemonic codes : abbreviations that easy to remember
• Requires a translator to translate the assembly program into
machine language ( assembler).
• Difficult to learn
• Machine-dependent ADD for Addition
MULT for Multiply
Programming Language: Assembly Language
• Low level language.
• Unique to particular computer.
• Use mnemonics symbols. E.g. “MULT” –Multiply
• Easier to understand.
• A program is written in source code (text file) and translated
into machine language by an assembler.
Programming Language: The Comparison
• A Machine-language Program Fragment and Its Assembly-
Language Equivalent

Memory Address Machine-Language Assembly-Language


Instructions Instructions

00000000 00000000 CLA

00000001 00010101 ADD A

00000010 00010110 ADD B

00000011 00110101 STA A


Programming Language: Different Language, different
Objective
• Programming languages have been developed to balance
conflicting goals
Programming Language: High-Level
• Made easy for programmer to develop and maintain program
• Machine-independent (can run on may different types of
computers)
• Have 3 categories : third, fourth and fifth generation
• Written in series of English-like words
• Must be translated to machine code first (Use translator)
Programming Language: High-Level
• Portable to many different computers.
• Easier to read, write, and maintain than machine and
assembly languages.
• Instruction are coded; programmers use this to write
programs.
• Example : COBOL (Business), FORTRAN (Scientific),
BASIC, Pascal, C, C++, C#, Java etc.
• Compiler/interpreter: translates a program (code) written
in a high-level language into machine language
Programming Language: The Example
Language Description Category
C A structured, general purpose High-level
language developed at Bell
Laboratories. C offers both high-
level and low-level features.
C++ Based on the C language, C++ High-level
offers object-oriented features not
found in C. Also invented at Bell
Laboratories
Programming Language: Other Popular Languages
• Python
• C
• Java
• C#
• JavaScript
• GO
• SQL
• Visual Basic
Programming Language: C and C++
Provides higher-level
programming features

Allows direct manipulation


of system memory and
CPU registers

Code runs fast and uses


small amount of memory

Basic components are


common to many
languages
Programming Language: Natural Language
• Like our natural language (such as Malay, English, French,
or Chinese)
• Its use is still quite limited.
• Tools that allow end users to create or customize computer
programs with natural language.
• For example “make me an app that suggests new careers
paths to me based on people with similar skills and
experiences who have successfully improved their salary
and quality of life with a new career.” (John Spacey, 2016)
Programming Language: Example
• How to write a statement for calculating salary, given the formula:
salary = rate × hour
• Machine language
100100 010001 //Load
100110 010010 //Multiply
100010 010011 //Store

• Assembly language
LOAD rate
MULT hour
STOR salary

• High-level language ( e.g. C++ Programming)


salary = rate * hour;
Programming Language: Language Translator
• A program need to be translated because a computer only understands
machine language
• Language Translator translates the source code from its
original language into machine code.
• Assembler
• Used in assembly language for translate the language to machine language
• Interpreter
• Translates one program code statement at a time. / translates and executes the
source code line by line or statement by statement
• Immediately displays feedback when it finds error.
• An interpreter executes code line by line without producing a separate executable
• Compiler
• Converts the entire source program into machine language at one time
• A compiler translates the entire code at once and produces an independent
executable
Programming Language: C++
• Is a multi-paradigm programming language (supports
structured, object-oriented, and generic programming).
• High level language.
• Is a case sensitive language.
• Developed by Bjarne Stroustrup (early 1980s).
• ANSI/ISO was established to standardize the syntax of C++
(early 1990s).
• ANSI/ISO C++ language standards were approved in 1998.
• Extends the C language.
Programming Language: Example of C++ Program
The C++ Program

The Output
Programming Language: The Need of Programming
Language
• A computer understands a program only if the program is
coded in its machine language.
• Thus, programming language need to be converted to
machine language (executable file)
Programming Language: Running a C++ File
From High Level Program to Executable Code
1) Programmer create and edit text file containing
the program (source code) with a text editor and
save it into file (source file)
2) Run
o preprocessor to process the preprocessor
directives (begin with #).
o compiler to:
• Check that the program obeys the rules
• Translate into machine language (object code)
o linker to connect hardware-specific code to
machine instructions, producing an executable
code.
3) Loader : Loads executable file into main memory
4) Execution : Execute the program
Programming Language: Running a C++ File
From High Level Program to Executable Code
Programming Language: Running a C++ File
Flow of Information During Program Execution
Programming Application: Integrated Development
Environment (IDE)
• Programming application refers to a software tool or
environment used to write, test, debug, and manage
programs or applications.
• An integrated development environment, or IDE, combine all
the tools needed to write, compile, and debug a program
into a single software application.
• Examples are Code Blocks, Microsoft Visual C, Borland C
Builder, CodeWarrior, BloodShed DevC++, etc.
IDE: Code Blocks
IDE: Online (programiz)
IDE: Online (onlinegdb)
REFERENCES
1) Aminatul Solehah Idris, Jasrul Nizam Ghazali, Mohamad Norzamani Sahroni, Muhd Eizan
Shafiq Abdul Aziz, Noorazida Mohd Idris, Norzaidah Md Noh, Nurhilyana Anuar, Raudzatul
Fathiyah Mohd Said, Teh Faradilla Abdul Rahman, Zakiah Noh, Zamri Abu Bakar,
Practical C++ for Beginners, 1st, Djuta Dallek Enterprise, 2025, ISBN: 978-629-95317
2) Paul Dietel, Harvey Dietel, C How to Program, 7, Pearson, 2013, ISBN: 9780273776840
3) H. H. Tan, T.B D'Orazio, S.H Or, & Marian M.Y. Choy, C Programming, McGraw Hill, 2012,
ISBN: 9780071311168
4) E. Balagurusamy, Programming in Ansi C, 6, Tata McGraw-Hill Education, 2012, ISBN:
9781259004612
5) D. S. Malik, C++ Programming, 5, Cengage Learning, 2011, ISBN: 9780538798136
6) Jeri R. Hanly,Elliot B. Koffman, Problem Solving and Program Design in C, 6, Prentice Hall,
2010, ISBN: 9780321601513
7) Alan Evans, Kendall Martin, Mary Anne Poasty, Technology in Action, 11, Pearson, 2015,
ISBN: 129208235

You might also like