2025
The CPU has 2 main parts: - Answer - The control unit and the arithmetic unit
A byte has how many bits? - Answer - 8 bits
Programming Syntax - Answer - The rules of grammar used by a language
Algorithm - Answer - A set of well defined steps for performing a task or solving a problem
System Software - Answer - The programs that manage the computer hardware and the programs that
run on them
In a C++ program two slash marks (//) indicate - Answer - the beginning of a comment
Literal data signs - Answer - Values that do not change while the program is running
Variable definitions - Answer - Every variable needs a definition
Numeric data points in C++ can be classified into two general categories - Answer - integer and floating
point
What symbol is used o begin a pre-processor directive - Answer - # (pound sign)
Directives DO NOT have to end with what symbol? - Answer - ; (semi-colon)
All variables must be - Answer - operationally defined
,The first character of an identifier must be what? - Answer - an alphabetic character or an underscore
After the first character you may use what characters? - Answer - alphabetic characters, number, and
underscore characters
Which of the following definitions are syntactically correct? - Answer - int MyVar; & int myVar
Unsigned integers always treat the sign bit as what part of the number? - Answer - Magnitude
what form is this constant: 0x75A - Answer - Base 8
what character does char c = "a"; compile into - Answer - char c
Classic C-strings end with what null terminator - Answer - \0
what does a floating point number type default to - Answer - signed
what are true and false represented by in C++ - Answer - 0 for false values and any non-zero value for
true values
In C++ the following relationship regarding type size is always true for all platforms - Answer -
sizeof(short) <= sizeof(int) <= sizeof(long)
The following statement displays: cout << 1 % 4 - Answer - it will produce 1
What program causes the program to wait until information is typed at the keyboard and the enter key is
pressed - Answer - Cin object
What operator always follows the Cin object? - Answer - >>
, What operator always follows the Cout object? - Answer - <<
What operator is used for concatenation? - Answer - + Plus sign
what can be used to override the rules of operator precedence in a mathematical expression? - Answer -
( ) Parenthesis
In the following C++ statement, what will be executed first according to the order of precedence?
result = 6 - 3 * 2 + 7 - ; - Answer - 3 * 2
This I/O manipulator in a cout stream is used to establish a field width for the value immediately
following it - Answer - setw() (set width)
What is the value of number after the following statements execute?
int number = 10;
number += 5;
number -= 2;
number *= 3; - Answer - 39
Which statement is equivalent to the following?
x = 2 * x; - Answer - x *= 2;