{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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
Image of page 1

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

View Full Document Right 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
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*/ // We need to include the input output stream library #include <iostream.h> // We need to include the math library #include <math.h>
Image of page 3

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern