3-Variables - Libraries Contain programs written by others,...

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

View Full Document Right Arrow Icon
Libraries Contain programs written by others, that your program can use… std:: #include < > What’s the difference? Where the actual code is kept.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Using the std:: library std::cout << “hello”; displays the string hello std::cout << x; displays the value of x std::cout << x << std::endl; skips to the next line after printing x std::cin >> x; // note >> takes keyboard input and sets the value of x
Background image of page 2
How do we use numbers? Counting Measuring Non-numerical designations: Finally, they can designate a “state” unrelated to the number (“1 if by land, 2 if by sea”)
Background image of page 3

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

View Full DocumentRight Arrow Icon
So computers Must deal with each type of number in it’s own way Must store those numbers in their own way Must make those numbers available, though, through a common interface That interface, is the “VARIABLE”
Background image of page 4
Variables x, y, z i, j, k TotalCountOfNewEmployees Geekish_Designations_0123 They Stand for Something, can be named anything but reserved C++ words
Background image of page 5

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

View Full DocumentRight Arrow Icon
Variable Types (primitive, common) Integers – meant to be a whole number (used for counting) C++: int Floating Pt. – meant to be a detailed number (used for measuring) – called a double Character – has no meaning other than to be
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 28

3-Variables - Libraries Contain programs written by others,...

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

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