TCO 11 Which of the following is false Complete Solution
1. (TCO 11) Which of the following is false? (Points : 4)
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. (TCO 7) Typically, the first item in defining a function is _____. (Points : 4)
an open curly brace “{“
passing an argument
passing the function
naming the function
3. (TCO 7) What is a variable's scope? (Points : 4)
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. (TCO 5) Float and double variables should not be used _____. (Points : 4)
as counters
to perform mathematical calculations
as approximate representations of decimal numbers
for applications when precision is required
5. (TCO 4) Consider the following segment of code.
if(apple != Orange)
cout<<"You got Oranges!"<else
cout<<"You got Apples";
cout<<"The end of the program is reached.";
What error can you identify? (Points : 4)
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. (TCO 4) What is the advantage of using the conditional operator? (Points : 15)
8. (TCO 11) 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.
(TCO 11) Which of the following is false Complete Solution
rules for creating variables 1. Characters Allowed : o Underscore(_) o Capital Letters ( A – Z ) o S...
A+ - Thank you!
Thanks for the positive feedback!