L04operations

L04operations - Basic Notions Review q q q q q q q q q q q...

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

View Full Document Right Arrow Icon
Basic Notions Review what is a variable? value? address? memory location? what is an identifier? variable name? keyword? what is legal identifier? what identifiers are legal? what are C-style? Pascal-style identifiers? what is variable type? what types have we studied? what is variable declaration? where (in the program) is a variable declaration placed? what is an assignment? what is a stream? input stream? output stream? cout? cin? what is an extraction/insertion operator? what is an escape sequence? what is an input token?
Background image of page 1

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

View Full DocumentRight Arrow Icon
Types, Expressions, More on Assignment
Background image of page 2
Int, Double and Others type is the kind of data that is stored in variables int - whole numbers double – numbers with fractions (called floating point ) since the storage is limited, fraction can contain only a limited number of digits (usually up to 14) two ways to write a double number in C++ regular: 2.0 -3.23 +0.0456 .45 dot needs to be there scientific or floating point: 5.89e5 .045E-4 5e+5 dot does not need to be there mantissa is limited in size. The largest allowable number differs for every architecture. Usually: int - up to 32767 double - up to 10 308 int or double (or any other type in C++) cannot contain a comma other possible types are short , float and long double
Background image of page 3

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

View Full DocumentRight Arrow Icon
Use of Char // asks for initials and outputs greeting #include <iostream> main (){ char first, second; cout << “Enter your initials: “; cin >> first >> second; cout << “Hello “ << first << second << endl; cout << “pleased to meet you\n”; }
Background image of page 4
bool (short for boolean) is used for branching and looping statements a boolean variable can have only two values true or false bool result; result = true; true and false are keywords and cannot be used as
Background image of page 5

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

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

Page1 / 20

L04operations - Basic Notions Review q q q q q q q q q q q...

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

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