1/11
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Most lines in a C++ program end with a
; (semi-colon)
main() marks the beginning of a C++ program. What C++ reserved word precedes it?
int
What is the correct way to declare an integer variable named "score"?
int score;
Given the following declaration:
double x;
What is the value of x?
garbage
According to the lecture notes, the two main conceptual components of a program are _____ and _____.
data and instructions
Given the following:
double price = 30.00;
double tax = 1.80;
double sum;
sum = price + tax;
Explain in detail what the last line does in terms of variables, calculations, and assignment of values.
The last line takes the variables price and tax, adds them together, and saves the result in the variable sum.
When you write an illegal C++ statement and try to compile and run the program, you will get a
compile error
What is the value (in C++) of the expression 4 / 2 * 2?
4
What is the value (in C++) of the expression 3/2?
1
Which data type has the largest range?
double
About how many decimal places of accuracy does a float have?
6
Modify (rewrite) the following instruction so that the subtraction is evaluated first:
i = a * b / c - d;
i = a * b / (c - d);