Shared Flashcard Set

Details

CISC 192 Chap 1,2,4 C++
Mesa College C++ 192 Back of the Book Answers
78
Computer Science
Undergraduate 2
12/04/2012

Additional Computer Science Flashcards

 


 

Cards

Term
2.20 An ______ is like a variable, but its value is read only and cannot be changed during the programs execution.
Definition
named Constant
Term
2.21 When do preprocessor directives execute?
Definition
Before the compiler compiles your program.
Term
2.22 A variable must be defined before it can be used.
Definition
True.
Term
2.23 Variable names may begin with a number.
Definition
False.
Term
2.24  Variable names may be up to 31 characters long.
Definition
True.
Term
2.25 A left brace in a C++ program should always be followed by a right brace later in the program.
Definition
True.
Term
2.26 You cannot initialize a named constant that is declared with the const modifier.
Definition
False.
Term
1.8 Computers can do many different jobs because they can be _____
Definition
programmed
Term
1.9 The job of the ______ is to fetch instructions, carry out the operations commanded by the instructions, and produce some outcome or resultant information.
Definition
CPU
Term
1.10 Internally, the CPU consists of the ______ and the ______
Definition
Arithmetic Logic Unit and Control Unit
Term
1.11 A ______ is an example of a secondary storage.
Definition
disk
Term
1.12 The two general categories of software are ______ and ______
Definition
System Software and Application Software
Term
1.13 A program is a set of ______
Definition
instructions
Term
1.14 Since computers can’t be programmed in natural language, algorithms must be writer in a _______ language.
Definition
programming language
Term
1.15 ______ is the only language computers really process.
Definition
machine language
Term
1.16 ______ languages are close to the level of humans in terms of readability.
Definition
high-level
Term
1.17 ______ languages are close to the level of the computer.
Definition
low-level
Term
1.18 A program’s ability to run on several different types of computers is called ______
Definition
portability
Term
1.19 Words that have special meaning in a programming language are called ______
Definition
key words
Term
1.20 Words of names defined by the programmer are called ______
Definition
programmer-defined symbols
Term
1.21 ______ are characters or symbols that perform operations on one or more operands.
Definition
operators
Term
1.22 ______ characters or symbols mark the beginning or ending of programming statements, or separate items in a list.
Definition
punctuation
Term
1.23 The rules that must be followed when constructing a program are called ______
Definition
syntax
Term
1.24 ______ is a named storage location.
Definition
variable
Term
1.25 A variable must be ______ before it can be used in a program.
Definition
defined
Term
1.26 The three primary activities of a program are ______, ______, and ______.
Definition
input, processing, output
Term
1.27 ______ is the information a program gathers from the outside world.
Definition
input
Term
1.28 ______ is information a program sends to the outside world.
Definition
output
Term
1.29 A ______ is a diagram that graphically illustrates the structure of a program.
Definition
hierarchy chart
Term
2.9 Every complete statement ends with a ______.
Definition
Semicolon.
Term
2.10 Which of the following statements is correct?
Definition
#include <iostream>
Term
2.11 Every C++ program must have a function ______.
Definition
main.
Term
2.12 Preprocessor directives begin with a ______.
Definition
#.
Term
2.13 Refer to Book
Definition
Pg 79
Term
2.14 A group of statements, such as the contents of a function, is enclosed in ______.
Definition
Braces {}.
Term
2.15 Refer to Book
Definition
Pg 79
Term
2.16 Which of the following are not valid cout statements?
Definition
all couts need cout << "Hello World";
Term
2.17 Refer to Book
Definition
Pg 79
Term
2.18 Refer to Book
Definition
Pg 79
Term
2.19 The negation operator is ______.
Definition
Unary.
Term
4.9. An expression using the greater than, less than, greater than or equal to, less than or equal to, equal, or not equal to operator is called a ______ expression.
Definition
relational
Term
4.10. A relational expression is either ______ or ______.
Definition
true, false
Term
4.11. The value of a relational expression is 0 if the expression is ______, or 1 if the expression is ______.
Definition
false, true
Term
4.12. The if statement regards an expression with the value 0 as ______
Definition
False.
Term
4.13. The if statement regard an expression with a nonzero value as ______
Definition
True.
Term
4.14. For an if statement to conditionally execute a group of statements, the statements must be enclosed in a set of ______
Definition
braces
Term
4.15. In an if/else statement, the if past executes its statement or block if the expression is ______, and else part executes its statement or block if the expression is ______.
Definition
true, false
Term
4.16. The trailing else is an if/else if statement that has similar purposed as the ______ section of a switch statement.
Definition
default
Term
4.17. The if/else statement is actually a form of the ______ if statement.
Definition
nested
Term
4.18. If the sub-expression on the left of the ______ logical operator is false. the right sub expression is not checked.
Definition
&& And
Term
4.19. If the sub-expression on the left of an ______logical operator is true, the right sub expression is not checked.
Definition
||Or
Term
4.20. The ______logical operator has higher precedence than the other logical operators.
Definition
! Net
Term
4.21. The logical operators have ______ Associativity.
Definition
left-to-right
Term
4.22. The ______ logical operator works best when testing a number to determine if it is within a range.
Definition
&& And
Term
4.23. The ______ logical operator works best when testing a number to determine if it is outside a range.
Definition
||Or
Term
4.24. A variable with ______ scope is only visible when the program is executing in the block containing the variable's definition.
Definition
block
Term
4.25. You use the ______ operator to determine whether one string object is greater then another string object.
Definition
> Greater
Term
4.26. An expression using the ______ operator is called an conditional expression.
Definition
conditional
Term
4.27. The expression that is tested by a switch statement must have an ______ value.
Definition
integer
Term
4.28. The expression following a case statement must be an ______.
Definition
integer constant
Term
4.29. A program will "fall through" a case section if it is missing the ______ statement.
Definition
break
Term
4.30. Refer to Book
Definition
Pg 215
Term
4.42 The = operator and the == operator perform the same operation when used in a Boolean expression.
Definition
False.
Term
4.43 A variable defined in an inner block may not have the same name as a variable defined in the outer block.
Definition
False.
Term
4.44 A condtionally executed statement should be indented one level from the if statement.
Definition
True.
Term
4.45 All lines in a block should be indented one level.
Definition
True.
Term
4.46 It's safe to assume that all uninitialized variable automatically start with 0 as their value.
Definition
False.
Term
4.47 When an if statement is nested in the if part of another statement, the only time the inner if is executed is when the expression of the outer if is true.
Definition
True.
Term
4.48 When an if statement is nested in the else part of another statement, as in an if else if, the only time the inner if is executed is whenthe expression of the outer if is true.
Definition
False.
Term
4.49 The scope of a variable is limited to the block in which it is defined.
Definition
True.
Term
4.50 You can use the relational operators to compare string objects.
Definition
True.
Term
4.51 x != y is the same as (x > y || x < y)
Definition
True.
Term
4.52 y < x is the same as x >= y
Definition
False.
Term
4.53 x >= y is the same as (x > y && x = y)
Definition
False.
Term
4.54 Refer to the Book pg 217
Definition
True.
Term
4.55 Refer to the Book pg 217
Definition
False.
Term
4.56 Refer to the Book pg 217
Definition
True.
Term
4.57 Refer to the Book pg 217
Definition
True.
Supporting users have an ad free experience!