




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





TRUE/FALSE. Fill 'A' if the statement is true and 'B' if the statement is false.
The fixed manipulator causes a number to be displayed in scientific notation. 1)
Software engineering is a field that encompasses designing, writing, testing, debugging, documenting, modifying, and maintaining computer hardware.
Escape sequences are always stored internally as a single character. 3)
If you want to know the length of the string that is stored in a string^ object, you can call the object’s size^ member function.
A CPU really only understands instructions that are written in machine language. 6)
A significant difference between the get function and the >> operator is that get reads the first character typed, even if it is a space, tab, or the [Enter] key.
C++^ does not have a primitive data type for storing strings of characters.^ 8)
If you do not follow a consistent programming style, your programs will generate compiler errors. 9)
When the fixed manipulator is used, the value specified by the setprecision manipulator will be the total number of digits displayed.
Floating point constants are stored in memory as doubles. 11)
The^ cin <<^ statement will stop reading input when it encounters a newline character.^ 12)
Arithmetic operators that share the same precedence have right to left associativity. 13)
When C++ is working with an operator, it strives to convert the operands to the same type. 14)
When a program uses the setw manipulator, the iosetwidth header file must be included in a preprocessor directive.
MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.
int x = 0; int y = 5; int z = 4; x (^) = y (^) + z * 2;
A) 13 B) 18 C) 0 D) unknown E) 5
A) source code, compiler, modified source code, preprocessor, object code, linker, executable code B) source code, preprocessor, modified source code, linker, object code, compiler, executable code C) preprocessor, source code, compiler, executable code, linker, modified source code, object code D) source code, linker, object code, compiler, modified source code, preprocessor, executable code E) source code, preprocessor, modified source code, compiler, object code, linker, executable code
1 //This program displays my gross wages. 2 //I worked 40 hours and I make $20.00 per hour. 3 # include
Which line(s) in this program cause output to be displayed on the screen?
A) 13 B) 15 C) 13 and 14 D) 8 and 9 E) 14
int number = 7; cout << "The number is " << "number" << endl;
A) The number is 7 B) The number is number C) The number is 0 D) The number is E) None of these
Unix and Windows 2000 are examples of ________ operating systems. 26) A) single tasking B) multi- tasking C) Macintosh D) command- driven E) None of these
Assume that a program has the following variable definition:
char letter;
Which of the following statements is(are) valid? (choose the most accurate answer)
A) letter = Z; B) letter (^) = "Z"; C) letter = 65; D) letter = 'Z'; E) C and D
This stream manipulator forces cout to print the digits in fixed- point notation. 28) A) setprecision(2) B) fixed C) setfixed(2) D) setw(2) E) None of these
When converting some algebraic expressions to C++, you may need to insert ________ that do not appear in the algebraic expression.
A) calculations B) exponents C) parentheses D) coercions E) None of these
int x; x = 8 /14;
A) 0 B) 4 C) 4.5 D) unknown E) 5
cout << "Four\n" << "score\n"; cout << "and" << "\nseven"; cout << "\nyears" << " ago" << endl;
A) Four score and seven years ago B) Four score and seven years ago C) Four score and seven years ago D) Four score and seven years ago E) None of these
int number = 10; number += 5; number - = 2; number *= 3;
x = - 3 + 4 % 6 /5;
E) None of these
int x; x = 2 % 4;
A) 0.45 B) 4 C) 2 D) unknown E) 3
cout << setw(4) << num4 << " ";
A) It outputs "setw(4)" before the value in the variable num4. B) It should use setw(10) to output the value in the variable num10. C) It inputs up to four characters stored in the variable num4. D) It allows four spaces for the value in the variable num4. E) None of these
In a broad sense, the two primary categories of programming languages are: 42) A) low- level and high- level B) single- tasking and multi- tasking C) COBOL and BASIC D) mainframe and PC E) None of these
Assuming you are using a system with 1- byte characters, how many bytes of memory will the following string literal occupy?
"William"
E) None of these
This is a set of rules that must be followed when constructing a program. 44) A) key words B) portability C) operators D) punctuation E) syntax
This term refers to the programmer reading the program from the beginning and stepping through each statement.
A) spot checking B) software engineering C) pseudocoding D) desk checking E) None of these
result = 6 - 3 * 2 + 7 - 10 /2 ;
This statement will pause the screen, until the [Enter] key is pressed. 47) A) cin.input(); B) cin.get(); C) cin.ignore(); D) cin.getline(); E) cin;
This is a volatile type of memory, used for temporary storage. 48) A) a floppy disk B) ALU C) a hard disk D) RAM E) None of these
Which line in the following program will cause a compiler error?
1 #include
int x; x = 18.0 /4;
E) None of above