C++ INTRO
C++ INTRO
101 EC
20/05/2024 Total no. of slides = 14
Learning Objectives
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
What is a Computer?
◦ A computer is an electronic device that takes input from the user and
processes these data under the control of a set of instructions (called a
program) gives the result (output) and saves it for future use. It can
process both numerical and non-numerical (arithmetic and logical)
calculations.
◦ Hardware – various devices comprising a computer
◦ Keyboard, screen, mouse, disks, memory, CD-ROM, and processing units
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
Computer Organization
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
What is programming?
Definition:
"A program is a precise sequence of steps to solve a particular
problem.”
It means that when we say that we have a program, it actually means
that we know about a complete set activities to be performed in a
particular order. The purpose of these activities is to solve a given
problem.
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
Machine Languages, Assembly Languages, and High-level
Languages
2. Assembly languages
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
1. Machine language (Low-level language)
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
2. Assembly languages (Low-level language)
– English-like abbreviations
representing elementary
computer operations
(Mnemonics translated via
assemblers)
– Programmers can write human-
readable programs that
correspond almost exactly to
machine language.
– Example:
MOV TOTAL, 48 ; Transfer the
value 48 in the memory variable
TOTAL
ADD AH, BH ; Add the content
of the BH register into the AH
register
AND MASK1, 128 ; Perform AND
operation on the variable MASK1
and 128
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
3. High-level languages
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
Some other High-level Languages
◦ A few other high-level languages have achieved broad acceptance
◦ FORTRAN
◦ for scientific and engineering applications
◦ COBOL
◦ used to manipulate large amounts of data
◦ Pascal
◦ intended for academic use
◦ C++
◦ advance version of C. applications in accounting and finance systems
◦ Java
◦ used over the internet.
◦ PL/1
◦ Programming Language one. Designed to use the key features of FORTRAN,
COBOL and ALGOL.
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
Language translators
compilers
interpreters
assemblers
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
History of C++
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,
History of C++
◦ C++ evolved from C, which evolved from two previous programming
languages, BCPL (Basic Combined Programming Language) and B.
◦ There are rich collections of existing classes and functions in the C++
standard library available for all programmers to use.
◦ Useful links:
https://www.youtube.com/watch?v=UdTzHmjMYBc
https://www.youtube.com/watch?v=JBjjnqG0BP8
https://www.youtube.com/watch?v=jsYLwJNv4l4
Bjarne Stroustrup,
Professor of Computer Science,
Asst. Prof. Dr SALAHUDDIN, School of Humanities and Sciences (S H & S), NUST, PAF Asghar Khan Academey,