1
Engr. Murad Habib
Assistant Professor/
Project Director
University of the Punjab
An Engineer and Computers
Engineers use computers extensively
to produce and analyze designs;
to simulate and test how a machine, structure, or
system operates;
to generate specifications for parts;
to monitor the quality of products; and
to control the efficiency of processes
Study some useful definitions
A Materials Engineer
A Materials Engineer a
man who looks for
connections between the
underlying structure of a
material, its properties, how
processing changes it, and
what the material can do its
performance.
3
Metallurgy
4
The MTM triangle
A logical relationship between processing, structure and properties,
and guarantee of success in new material development
Structure
Properties
Processing
Semiconductors
Micro-Electrical-
Mechanical Systems
(MEMS)
6
The Computer
A computer is a
machine that
manipulates data
according to
a set of instructions.
Storage
Computers
Device that accepts input, process and stores data, and
gives output
Device that can execute specific set of instructions in a
well-defined manner
Smaller and thinner than a
dime, this tiny silicon chip
contains millions of
transistors that work
together
Parts of a Digital Computer
Process Units
Computer Software
Programs and data in electronic form on a storage
medium
Program- Sequence of Instructions
Computer
Hardware Software
SDR-RAM DDR-RAM
DDR II-RAM
DDR III-RAM
Flash memory (memory cards, USB flash
drives), CD, DVD...
Q- keyboard
F- keyboard
Mouse
Touchpad-
Touch Screen
Laptop
Monitor
Dot matrix, ink jet, bubble jet, and laser are some of the types of available
printers
Examples are:
31
Dev-C++
New Source File
Compile
Run
32
Application Programs
Examples are:
Microsoft Word
AutoCAD,
SolidWorks
Catia
34
Program
A precise sequence of steps to
solve a particular problem
Critical Skills
Analysis
Critical Thinking
Attention to Detail
Design Recipe
To design a program properly, we must:
Analyze a problem statement, typically
expressed as a word problem
Express its essence, abstractly and with
examples
Formulate statements and comments in a
precise language
Evaluate and revise the activities in light of
checks and tests
Area of the Ring
Inner Circle
Outer Circle
It contains
Editor
Compilers
Debugger
Linkers
Loaders
Lifecycle of a C++ Program
xterm An IDE
window
console/terminal/window
Makefile WebCAT
make turnin/checkin E-mail
make utility
Runtime/utility
libraries
(binary) .lib .a .dll .so Eclipse
C++ Visual Studio
Programmer source code
(you) debugger
precompiler
gcc, etc. link
compiler linker executable
compiler program
object code
(binary, one per compilation unit) .o
Program is created in the
Editor Disk editor and stored on disk.
Preprocessor program
Preprocessor Disk processes the code.
Compiler creates
Compiler Disk object code and stores
it on disk.
Linker Disk Linker links the object
code with the libraries
Primary Memory
Loader
Loader puts program
in memory.
Disk ..
..
..
Primary Memory
CPU takes each
CPU instruction and
executes it, possibly
storing new data
..
.. values as the program
..
executes.
History of C and C++
History of C
Evolved from two other programming languages
BCPL and B
Typeless languages
Dennis Ritchie (Bell Laboratories)
Added data typing, other features
Development language of UNIX
Hardware independent
Portable programs
1989: ANSI standard
1990: ANSI and ISO standard published
ANSI/ISO 9899: 1990
42
History of C and C++
History of C++
Extension of C
Early 1980s: Bjarne Stroustrup (Bell Laboratories)
Spruces up C
Provides capabilities for object-oriented programming
Objects: reusable software components
Model items in real world
Object-oriented programs
Easy to understand, correct and modify
Hybrid language
C-like style
Object-oriented style
Both
43
The C Programming Language
Developed by Dennis Ritchie at AT&T Bell Laboratories
in the early 1970s
Growth of C tightly coupled with growth of Unix: Unix
was written mostly in C
Success of PCs: need of porting C on MS-DOS
Many providers of C compilers for many different
platforms => need for standardization of the C language
1990: ANSI C (American National Standards Institute)
International Standard Organization: ISO/IEC 9899:1990
1999: standard updated: C99, or ISO/IEC 9899:1999
General Program Structure
preprocessing directives
int main()
{
declarations;
statements;
}
45
#include <iostream>
main ( )
{
cout << Welcome to University ;
}
A Very Simple C++ Program
60