You are on page 1of 21

ME 240 Computer Programming

Week 1
Introduction to the course

Lecture slides are modified by Dr. B. Kanber, based on original slides by Dr. A. Bingl and Dr. A. Beddall

Sayfa 1

Introduction to Computer Programming


Computer programming is an essential part of the work of many scientists and engineers. This semester we will teach the C++ Programming Language which
is not easy to learn (compared to Fortran) Is a huge language with a lot of technical details is good at system and application programming is mostly prefered by engineers and young programmers! is widely used in the software industry We will concentrate on only a very basic/minimal subset of C++

Sayfa 2

Web Resources for the Course


Course Web Page www.gantep.edu.tr/~kanber/ME240 University of Gaziantep C++ resource page cpp.gantep.edu.tr - Tutorials, Sample Programs, Howtos - We will follow the Basic tutorial section. C++ Resources Network: www.cplusplus.com C++ Reference: www.cppreference.com Trke C Programlama Diline Giri: www.gantep.edu.tr/~bingul/c Also search Google and Wikipedia for any of the expressions used in this course.
Sayfa 3

Course Books
Essential C++ for Engineers and Scientists, Jeri R. Hanly, Addison-Wesley (2002) ~ 80 $

Programming with C++, John R. Hubbard Schaum Outline Series (2000) ~ 15 $ Practical C++ Programming, Steve Qualline OReilly Media (2003) ~ 25 $
Sayfa 4

Course Content
Introduction to Programming History of C++ Structure of C++ C++ Basics
Fundamental Input / Output, Data Types, Strings, Operators, Variables, Constants, Intrinsic Functions

Control Structures: Selection & Loops Functions Arrays Multidimensional Arrays Vectors File Processing Introduction to Classes
Sayfa 5

Lectures, Labs, Attendance, Exams


FIRST EDUCATION
Mondays
two-hour lecture 10:30-12:20 in BIM lab 3

Wednesdays
two-hour programming session 8:30-10.20 in BIM lab 3

Attendance
You must attend at least 70% of the course

Exams
All are written exams First midterm Second midterm Quizes Final 20% 20% 20% 40%
Sayfa 6

Lectures, Labs, Attendance, Exams


SECOND EDUCATION
Mondays
two-hour lecture 18:50-20:35 in BIM lab 3

Wednesdays
two-hour programming session 17:00-18.45 in BIM lab 3

Attendance
You must attend at least 70% of the course

Exams
All are written exams First midterm Second midterm Quizes Final 20% 20% 20% 40%
Sayfa 7

Computer Labs
We will learn C++ using the Dev-C++ compiler under Windows; you may also use Linux , e.g. Ubuntu, gul4.bim... Every week you should write a few programs yourself in the BIM lab (and more in your free time). In the BIM Computer Labs your programs will be deleted when the computer reboots. So you need to save them on a flash drive or on the internet.

DO NOT FORGET TO BRING YOUR LAPTOP or FLASH DISK WITH YOU


Sayfa 8

The Computer
See http://en.wikipedia.org/wiki/Computer A computer is a machine that manipulates data according to a set of instructions. The first computers were developed in 19401945, they were very large in size! Modern computers are based on integrated circuits making them very fast and small in size.
Sayfa 9

Sayfa 10

Parts of a Digital Computer


A computer can be divided into two main parts: Hardware and Software.
Hardware (=Donanm) 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
Sayfa 11

Parts of a Digital Computer


Storage Units
These are used in both input and output of data:
HDD (Hard Disk Drive) high capacity, relatively cheap, slow. RAM (Random Access Memory) low capacity, expensive, but very fast. Others: Flash memory (memory cards, USB flash drives), CD, DVD...

Sayfa 12

Parts of a Digital Computer


Input Units
Used for input of data:
Keyboard, Mouse Touch screen/pad RAM, HDD Flash memory

Sayfa 13

Parts of a Digital Computer


Output Units
Used for output of data:
Monitor Printer Speaker RAM HDD Flash Memory

Sayfa 14

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

Sayfa 15

Parts of a Digital Computer

A program is input from an HDD(1) and executed in RAM(2). 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.
Sayfa 16

Parts of a Digital Computer


Software (=Yazlm) 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

Sayfa 17

Parts of a Digital Computer


Operating System (OS)
The OS is a program written to interface between the computer and its user. All other software runs under the OS. Examples are: Miscrosoft Windows (XP, Vista, 7) Linux (e.g. Redhat, Ubuntu, Pardus) Mac OS X. These are all created using C++
Sayfa 18

Parts of a Digital Computer


Compilers
See http://en.wikipedia.org/wiki/Compiler 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). Examples are: Fortran C, C++ Java Pascal Basic. These are all created using C++
Sayfa 19

Parts of a Digital Computer


Application Programs
These are (usually compiled) programs written to perform a specific task. Examples are: Microsoft Word AutoCAD Mozilla Firefox.... These are all created using C++
Sayfa 20

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

Sayfa 21

You might also like