C++
Which of the following menu commands in Microsoft Word would involve reading from a file
File > Open
What would you use to assign to a variable information that a user inputs when the program is running?
cin
What is a project?
A container for your program and other files Visual Studio needs to run your code
Which of the following at be included in a function body?
A return statement such as return 0;
Which of the following is a unit of memory?
Byte
What is compiling?
Converting C++ code into code that a computer understands
What is the purpose of a function prototype?
To enable you to define a function after it's callec
What does return do?
It sends a value from a called function back to the calling functiom
What is a good example of an indefinite loop?
Keep requiring the user to enter a score until the user enters a number within a certain range
What is the purpose of cin.getline?
To obtain user input, which may include an embedded space
Which of the following is the purpose of a flow chart?
To show visually the flow of a program
True or false: && has a higher precedence than ||
True
What data type may be used to write to but not read from a file?
Ofstream
What is the number of the index of the last element of an array?
One less than the number of elements
In which function is the name and location of the file an argument?
Open
What refers to x++ in the code (int x=1; x<=5; x++)?
Update
What is the type of error that occurs if your program builds but ends before it is supposed to, or "crashes"?
Runtime error
What is a program?
Software that a customer or end-user may run
Which of the following do you as a programmer write?
Source code in a cpp file
What is a data type where you would store a person's name?
String
In the statement int*tests; what does * indicate?
That tests is a pointer
When do you need to use curly braces in an if statement?
When one or more statements are conditional on a relational expression being true
What best describes the concept of associativity?
Which arithmetic operation goes first if the arithmetic operators have equal precedence
What is C++
a programming language
What is the data type of a relational expression?
bool
In which loop is the comparison at the bottom rather than the top of the loop structure?
do while
Which of the following can you use to determine the amount of memory as data type uses?
sizeof
Which of the following is an expression?
sizeof(int);
Which of the following combines code from your project with the C++ runtime library files?
Linker
Which language does a computer understand?
Machine language
What arithmetic operator can't be used with floating point numbers as well as whole mumbers?
Modulus
What is a relational expression, assuming a and b are both integer variables that each have been previously assigned a value?
a==b
Given the declaration int tests[5]; which statement would best access each element of the array?
for(int x=0; x<5; x++)
What should you use to assign to a string variable user input that includes an embedded space in a string?
getline
Which of these is a logical operator that requires only one of the relational expressions to be true for the overall expression to be true?
||
What arithmetic operator is used with strings as well as numbers?
Addition
Which of the following files can you run by itself as a program?
An executable, or exe, file
Where is the best place to put a cin.ignore() statement?
Between a cin statement and a cin.getline statement
What converts C++ code into object code?
Compiler
Why do you use functions in a program?
To break up your code into more manageable and logical portions
What is a logical operator that reverses the truth of a Boolean expression, making a true expression false and a false expression true?
!
Which of these is a logical operator that has higher precedence than the relational operators?
!
Given the array declaration char name[80]; and then the statement cin >> name; what will be the result if the user types "Jeff Kent"?
"Jeff" will be assigned as the value of the character array
What will be the result of the statement char name[80] = Jeff;?
"Jeff" will be assigned to the character array name
Which of the following is a logical operator that requires both relational expressions to be true for the overall expression to be true?
&&
What is used to assign a variable a value given by the programmer?
=
Which operator is used with cin?
>>
What is the purpose of the delete keyword in dynamic memory allocation?
Deallocate memory
Which of the following is a step involved in writing a function in addition to main?
Defining the function
What window provides detailed information on any compiler errors, such as description and line numbers?
Error list
C++ doesn't have a built-in arithmetic operator for which of the following operations?
Exponent
What member function should you use to test if a file exists?
Fail
Which member function should you use to test if you're at the end of a file?
Fail
What is not a good choice for an indefinite loop?
For
In an "if" statement, which of the following must you have one, but only one?
If
In the parentheses following the "for" keyword, what is the first part before the first semicolon?
Initialization
Given the array declaration char name[80]; what will be the result of this statement; cout << name;?
Output of a number of strange looking characters
If you declare an array int students[5]; what will be the result of the statement cout << students;?
Output of the address of the array
In the expression 2+3*4, which concept applies to whether addition or multiplication is the first operation?
Precedence
What is the area of memory where a program's instructions and data are stored?
RAM