You are on page 1of 27

AE 108

INTRODUCTION TO
COMPUTER
PROGRAMMING

Lecture 1

Introduction to the course

1
Course Content
Introduction to the course and computer
C++ Structure and programming
C++ Data types
C++ operators, intrinsic functions,
and strings
Control structures: Selection-I
Computer Lab-1
Control structures: Selection-II
Computer Lab-2
Control structures: Repetitive structures-I
Computer Lab-3
Control structures: Repetitive structures-II
Computer Lab-4
Formatted I/O and File processing
Computer Lab-5
Review
MIDTERM-1

2
Functions I:
Introduction and Basics (Part I)
Computer Lab-6
Functions II:
Introduction and Basics (Part II)
Computer Lab-7
One-dimensional Arrays
Multi-dimensional Arrays
Computer Lab-8
Vectors
Computer Lab-9
General Review
MIDTERM-2

3
Lectures, Labs, Attendance, Exams
 Monday
 two-hour programming session 08:30-10:10 in Com. Lab.
 Tuesday
 two-hour programming session 08:30-10:10 in Com. Lab.
 Attendance
 You must attend at least 70% of the course

 Exams
All are written exams
 First midterm 30%
 Second midterm 30%
 Final 40%

4
Compiler and Computer Labs
 We will learn C++ using the Orwell Dev-C++ compiler under Windows
 It is free compiler and you can download from

 http://sourceforge.net/projects/orwelldevcpp/

 Every week you should write a few programs yourself


in the lab.

 In the Computer Labs your programs will be deleted when the computer
restarted. So you need to save them on a flash drive or on the internet.

 If you have a Smartphone, you can download and install


CppDroid from PlayStore. Then you can check your C++
program at anywhere you want.
The Computer
 A computer is a machine
that
manipulates data
according to
a set of instructions.
 The first computers
were developed in 1940–
1945,
they were very large in
size!
 Modern computers are
based on integrated
circuits
making them very fast
and
6 small in size.
Parts of a Digital Computer

A computer can be divided into two main parts:


Hardware and Software.

Hardware (=Donanım)
See http://en.wikipedia.org/wiki/Hardware

Hardware is the electronic and


mechanical parts of the computer.

- Storage Units
- Input Units
- Output Units
- Process Units
7
Parts of a Digital Computer
Storage Units

These are used in both input and output of data:

 HDD (“Hard Disk Drive”) SSD(“Solid State Disk”)


– high capacity – moderately high capacity
– relatively cheap – very expensive
– slow – very very fast

 RAM (“Random Access Memory”)


– low capacity, expensive, but very fast.

 Others:
Flash memory (memory cards, USB flash drives), CD, DVD...
8
HDD (“Hard Disk Drive”)

 A hard disk drive is a device for storing and retrieving digital


information, primarily computer data.
 It consists of one or more rigid (hence "hard") rapidly
rotating discs (platters) coated with magnetic material, and
with magnetic heads arranged to write data to the surfaces
and read it from them

9
RAM (“Random Access Memory”)

Random-Access Memory (RAM)


RD-RAM
device allows stored data to be
accessed in very nearly the same
amount of time for any storage
location, so data can be accessed
quickly in any random order.

SDR-RAM DDR-RAM

DDR II-RAM

DDR III-RAM

10
Flash memory (memory cards, USB flash
drives), CD, DVD...

A USB flash drive is a data storage device that


includes flash memory with an integrated Universal
Serial Bus (USB) interface.

Secure Digital or (SD) is a non-volatile memory card


format for use in portable devices.

The Compact Disc, or CD for short, is an optical disc


used to store digital data.

11
Parts of a Digital Computer
Input Units

Used for input of data:

 Keyboard,
 Mouse
 Touch screen/pad
 RAM,
 HDD
 Flash memory…

12
Keyboard

A keyboard is a typewriter-style device, which uses an arrangement of


buttons or keys, to act as mechanical levers or electronic switches

Q- keyboard

F- keyboard

13
Mouse

A mouse is a pointing device that functions by detecting two-dimensional


motion relative to its supporting surface

Mechanical Optical Mouse Roller Mouse


Mouse

14
Touch screen/pad

A touchpad (or trackpad) is a pointing device featuring a tactile sensor, a


specialized surface that can translate the motion and position of a user's
fingers to a relative position on screen.

Touchpad-
Touch Screen
Laptop

15
Parts of a Digital Computer
Output Units

Used for output of data:

 Monitor
 Printer
 Speaker
 RAM
 HDD
 Flash Memory

16
Monitor

A monitor or display (also called screen or visual display unit) is an


electronic visual display for computers.

CRT Monitor LCD-LED Monitor

17
Printer

A hardware device used to print "hard copies" of documents created or stored


on the computer.

Dot matrix, ink jet, bubble jet, and laser are some of the types of available
printers
Dot Matrix Ink Jet Laser

18
Speaker

A loudspeaker or speaker, is an electromechanical transducer which converts


an electrical signal into sound

19
Parts of a Digital Computer

Process Units

CPU: Central Processing Unit

This coordinates the operation of computer system


and performs arithmetic logic operations.

Input unit CPU Output unit

20
Parts of a Digital Computer

Data is input from a keyboard(3) which is again stored in RAM(4).


The CPU operates on the program and data in RAM(5) and
outputs results to the HDD(6) as well as the monitor(7).

This is all controlled by the CPU requiring only basic


data flow instructions from the programmer.

21
Parts of a Digital Computer
Software (=Yazılım)
See http://en.wikipedia.org/wiki/Software

Software consists of programs loaded from storage units.


The programs execute on the computer hardware forming,
for example,

 Operating System (OS)


 Compilers
 Application Programs
 …

22
Operating System (OS)
The OS is a program written to interface
between the computer and it’s user. All
other software runs under the OS.

Examples are:
 Miscrosoft Windows (XP, Vista, 7,8)
 Linux (e.g. Redhat, Ubuntu, Pardus)
 Mac OS X.

23
Compilers

Many programming languages require a


compiler to translate the statements of
program written in a high level language into
a low level language (machine code).

In this course we will use Dev C++ compiler


to obtain the executable forms of our
programs.

Ms. Visual Studio and Borland C++ can also


be used for compiling our C++ programs

24
Application Programs

These are (usually compiled)


programs written to perform a
specific task.

Examples are:

Microsoft Word
AutoCAD,
SolidWorks
Catia
ANSYS

25
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

26
Computer Languages
Language Application Area Origin of Name
Fortran Scientific programming Formula translation
COBOL Business data processing Common Business-Oriented Language

Lisp Artificial intelligence (AI) List processing


C Systems programming Predecessor language was named B

Prolog Artificial intelligence Logic programming


Ada Real-time distributed systems Ada Augusta Byron collaborated with
nineteenth-century computer pioneer
Charles Babbage

Smalltalk Graphical user interfaces; Objects "talk" to one another via


object-oriented programming messages

C++ Supports objects and Incremental modification of C (++ is


object-oriented programming the C increment operator)

Java Supports Web programming Originally named "Oak"


27

You might also like