1. Which of the following is false?
- All elements of the array have the same data type.
- All elements in an array have the same name.
- All elements in an array have the same subscript.
- The first element of the array has a subscript of zero.
2. Typically, the first item in defining a function is _____.
- an open curly brace "{"
- passing an argument
- passing the function
- naming the function
3. What is a variable's scope?
- The length of time the variable is in existence
- Determines who can see and access the variable
- It is the length of time the variable is in existence, AND determines who can see and access the variable.
- None of these
4. Float and double variables should not be used _____.
- as counters
- to perform mathematical calculations
- as approximate representations of decimal numbers
- for applications when precision is required
5. Consider the following segment of code.
if(apple != Orange)
cout<<"You got Oranges!"cout<<"You got Apples";
cout<<"The end of the program is reached.";
What error can you identify?
- A double quotation mark was incorrectly inserted.
- You cannot compare apples to oranges.
- Assumes indentation has a logical purpose
- No error
6. Explain the naming rules for creating variables, and then provide three examples using the data types int, double, and char and assign values to them.
7. What is the advantage of using the conditional operator?
8. Create a C++ program that declares, initializes, and outputs the values contained in a two-dimensional array
9. Create a code segment that defines a class definition for a student. Include at least two properties and two methods. Also explain the reason why there is a public and private section associated with class definitions.