Lec3 - Lecture 3: Introduction to C+ C+ is the name of a...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 3 Introduction to C++ 1 Lecture 3: Introduction to C++ C++ is the name of a compiler A compiler takes words and creates computer instructions MS Visual C++ is one of the most popular PC C++ compilers Borland Builder is probably number 2 Dozens of other C++ compilers are available Other languages Fortran, Basic, Pascal, Java Learning one language makes learning others easier
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture 3 Introduction to C++ 2 Solving a problem Distance between two points d = ( (x b -x a ) 2 +(y b -y a ) 2 ) 1/2 Naming variables x1, y1? xa, ya? x_of_a, y_of_a? C++ variables must start with a letter, can use numbers and underscore, but not blanks or special characters like & or $ Variables are case sensitive Recommend using lower case Variable types Integers (int), float, double, char, logical (bool) Manipulating variables Assignment Statements Arithmetic A(x a , y a ) B(x b , y b ) d
Background image of page 2
Lecture 3 Introduction to C++ 3 The code (shown in chunks, but really it is a continuous file) /* This program calculates the distance between two points in a plane*/ #include #include <math.h> // Start the main function void main()
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/26/2008 for the course ENGR 1 taught by Professor X during the Spring '07 term at Lehigh University .

Page1 / 16

Lec3 - Lecture 3: Introduction to C+ C+ is the name of a...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online