2. Course Objectives
• After successfully completing this course, you will be able to:
• What is a computer system and how it works.
• Flow charts and Algorithms.
• Computer programming concepts and their implementation in C++ language.
3. Course Outline
• Introduction to Computer and Programming Languages.
• Elements of C++ Language.
• Control Structures.
• Working and Understanding Arrays.
• Working with Structures, Union and Enumeration.
4. Text Books to Follow
• Dietal & Dietal, C/C++: How to Program 7th Edition.
• Programming with C++ by CM Aslam & TA Qureshi (Aikmen Series).
• Object oriented programming using C++ by IT Series.
5. Lecture Outline
• Introduction to computers and computer organization
• Personal, Distributed and Client/Server Computing
• Programming languages
• Components of programming languages
• Programming techniques
6. Introduction to Computer
• An electronic machine that can perform computations and logical
decisions at a speed of millions and even billions of times faster than
human being.
• Processes data under control sets of instructions called program.
• A program is a set of instructions that is used to perform a specific
task.
• Programs are written by programmer.
• Programming Languages are the source through which a
programmer writes and develops computer programs.
7. Introduction to Computer
• Computers are comprised of two parts:
• Hardware-
• Software
Hardware
Electronics circuit boards
that provide
functionality of the system
Software
Program consists
of sets of instructions
that control the system
9. Computer Organization
• Input Unit
• Receiving section of the computer.
• Gets data from various devices and places.
• Data is entered into computer with the help of mouse & keyboard.
• Data can also be entered in the form of voice and images via scanner and
microphone.
10. Computer Organization
• Output Unit
• Shaping section of the computer.
• Takes information from CPU and places it on various output devices.
• Information can be viewed either on screens or printed papers.
11. Computer Organization
• Memory Unit
• Short time warehouse section of computer.
• It keeps the data that has been entered so that it can be available for
processing.
• It also keeps the processed data so that information can be placed on output
devices by output unit.
12. Computer Organization
• Arithmetic & Logic Unit
• Manufacturing section of computer.
• It is responsible for calculations and logical operations.
• Calculation involves addition, subtraction, multiplication and division.
13. Computer Organization
• Control Unit
• Administrative section of computer.
• It supervises the operations of the other sections.
• It control and allocates jobs for all other units.
• Many of today’s computers have multiple CPUs and, hence, can perform
many operations simultaneously – multicore processors.
• Dual-core processors – Two CPU’s
• Quad-core processors – Four CPU’s
15. Computer Organization
• Secondary Unit
• Long time warehouse section of computer
• Program and data that are not actively used by the other units are normally
placed on secondary storage time.
• It stores the data permanently for future time.
• Non-Volatile Memory
16. Personal, Distributed and Client/Server
Computing
• Using desktop and laptop computers for personal use – Personal
computing.
• In 1977, Apple computer popularized Personal computing.
• In 1981, IBM the world’s largest computer vender, introduced the
IBM Personal Computer.
• Stand-alone – transported disks back and forth between them –
Sneakernet.
17. Personal, Distributed and Client/Server
Computing
• Machines could be linked together in computer networks, over
telephone lines in LANs that led to the phenomenon of distributed
computing.
• Distributed computing is a model in which components of a software
system are shared among multiple computers to improve efficiency
and performance.
18. Personal, Distributed and Client/Server
Computing
• In Client/Server computing:
• Servers provides services such as file servers, database servers, web servers
and etc…
• Client computers uses the services provided by the server.
19. Programming Languages
• A programming language is used to write computer programs.
• It is an artificial language designed to communicate instructions to a
machine.
• Some of them are directly understandable by computer and some of
them are needed to be converted first.
20. Programming Languages
• Computer languages are divided into three broad types:
• Machine Language
• Assembly Language
• High-Level Language
21. Programming Languages
• Machine Languages
• A computer understands machine language.
• Machine language is also called binary language.
• It is consist of two digits that instructs computers to perform their operations.
• They are machine-dependent.
• No translation is required – directly understandable by computer.
• They are hard to learn and understand.
23. Programming Languages
• Assembly Language
• A language in which instead of binary codes we use English like abbreviations
(mnemonics) to represent the operations for the computer.
• A language that uses symbolic names to represent operations, registers and
memory locations.
• It uses a translator called Assembler.
25. Programming Languages
• High-Level Language
• A language in which the instructions are written in the form of everyday
English and contain commonly used mathematical notations.
• Compiler and Interpreter are used to covert the high-level code to machine
code.
28. Components of Programming Languages
• Syntax
• It is about the structure of the grammar of the language.
• In programming language, the rules and regulations for writing code are
called the syntax.
• A syntax can be used to construct a valid sentence/statement.
29. Components of Programming Languages
• Semantic
• It describes the meaning of the sentence.
• It describes that whether the sentence is correct or not. If so, what does the
sentence mean?
30. Categories of Programming Languages
• Major programming languages falls in the category of:
• Structured Programming Languages
• Modular Programming Languages
• Object-Oriented Programming Languages
31. Categories of Programming Languages
• Structured Programming Languages
• Languages in which the program is divided into smaller components –
functions.
• The structured programming contains three major concepts that are:
• Top-down Design / Divide and Conquer
• Code Reusability
• Information Hiding
32. Categories of Programming Languages
• Modular Programming Languages
• Languages in which the program is broken into individual components called
modules that can be programmed and tested independently.
33. Categories of Programming Languages
• Object-Oriented Programming Languages
• Languages in which object technology is supported.
• It allows the pieces of software to be reused and interchanged between
programs.
• The major concepts used in OOP are:
• Data Abstraction – Describes user defined datatypes.
• Encapsulation – Information Hiding
• Inheritance – Describes the reusability of a class.
• Polymorphism – Describes the ability to produce different results based on the object
that is sent to.
34. Summery
• Introduction to computers and computer organization
• Personal, distributed, and client/server computing
• Programming languages
• Components of programming languages
• Categories of programming languages