Intro to Programming Study Guide Flashcards
T/F C++ is an example of a high level language.
True
T/F C++ is an example of an interpreted language.
False
What are the semantics of a programming language?
the meaning attached to the instructions
What is the syntax of a programming language?
how instructions are written
What are the different types of identifiers?
variables and constants
Memory for variables is determined at _____ and the values are stored at ______.
compile time, run time
Memory for constants is determined at _____ time and the values are stored at _____.
compile time, compile time
What are the 3 differences in how we declare variables versus constants?
assign values to constants
declareVariables vs. DECLARE_CONSTANTS
const before declaring constants
When would we declare an identifier a constant?
when we don’t change its value, when we need to use a literal
What is a literal in C++
an actual value
What are the 2 things the compiler needs to know when we declare an identifier? How do we provide this information to the compiler?
the data type, how much memory needs to be stored
the datatype
What is the difference between ‘A’ and “A” in C++?
‘A’ - single character
“A” = C-string of 2 characters (‘A’ & ‘\0’)
How would we declare a c-string variable which could store a name of up to 10 characters?
char name[11]
How would we declare a constant named A which would store the single value ‘A’?
const char A = ‘A’
What data type would we use to store the average of a sum of integers?
float