tuesday, december 05, 2006 i hear and i forget, i see and i remember, i do and i understand -chinese...

30
Tuesday, December 05, 2006 I hear and I forget, I see and I remember, I do and I understand -Chinese Proverb

Post on 20-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Tuesday, December 05, 2006

I hear and I forget,

I see and I remember,

I do and I understand

-Chinese Proverb

CS 192 / CMPE 191

First course in programming using C++

Course OutlineCourse Website URL http://suraj.lums.edu.pk/~cs192w06/

Information about the course, office hours, contact information, announcements, lecture-slides, tutorials, source code …

\\indus\Common\cs192w06Overview of C++

CS192 / CMPE 191 ‘Problem Solving and Computer Programming’

Make use of office hours.

Course builds on top of previous discussion.

Don’t hesitate to ask questions in class.

5 minute rule!

What is a program? -

C++ programming language.

•High level language

What does the computer understand?

What do we need here?

#include <iostream.h>int main(){ cout<<“Hello\n”;}

myprogram.cType your C++ program into a text file

It is human-readable

myprogram.exe

machine-readable

Compiler Source code Object code

What happens when you start a program?

C++ What’s with the name?

In 1970s

Developed by Dennis Ritchie of AT&T Bell Laboratories

It was first used for writing UNIX operating system

Widely used in programmer community

ANSI (American National Standards Institution) standard C (1983)

Some history …

Advantages of C

Built-in power Efficiency Flexibility Library routines

From C to C++ (1980 – Bell Labs)

Reason : Increasing complexity of programs

Bjarne Stroustrup of AT&T Bell Laboratories developed C++ in 1980s.

Most of C is a subset of C++

From C to C++ (1980 – Bell Labs)

High performance system software is constructed using C++

C++: Enhancement to C

Real programmers language

Also it is …

a lot of

FUN!FUN!

Computer Science Fundamentals (CS 111)

Object Oriented Programming (CS 292)

Data Structures (CS 213)Operating Systems (CS 381)

My assumptions

Knowledge of A text editor Files Some experience of using Windows

operating system. General knowledge of what computer

hardware / software is.

Basic C++ Program Structure.

Statements

Input / Output (I/O)

CompilerLinker

#include <iostream.h>int main( ){cout <<"Welcome to CS192/CMPE191";return 0;

}

Include directives

iostream is the name of library that contains definition of routines that handle input and output.

iostream.h is a file that contains information about this library

Welcome to CS192/CMPE191

Comments have two forms in C++//Single line comments/*Multi-line

comments*/

/* comments ignored by compiler */// comments required by some organizations!