Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Absolute C++
Quiz 5: Arrays
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Question 1
True/False
Given the two C++ array declarations: int a[10],b[10]; You can successfully compute one array,say a,then assign b to a: a = b;
Question 2
True/False
Arrays in C++ may have several different types stored in them.
Question 3
Essay
Distinguish the use of the square brackets [] in a definition of an array and their use for access to some indexed variable of the array.
Question 4
True/False
When using an array,it is perfectly legal to access indexed variables with index values less than 0 or greater than or equal to the declared size of the array.
Question 5
True/False
Indexed variables for an array are stored wherever the computer finds memory for the first indexed variable,then the next one is stored next to the first if there is space,and someplace else if not.
Question 6
True/False
To call a function with an array parameter,write the array argument as the array name followed by empty square brackets,as in f(a[],7); (The first argument is an array a,the second is the size. )
Question 7
True/False
In the sequential search algorithm,items are examined alternately,odd then evens,in order to find whether the target value is in the array (and if the target is present,to the index of the target. )
Question 8
True/False
The programmer should always use a defined constant in an array declaration.
Question 9
True/False
C++ arrays check for out-of-range index values.
Question 10
True/False
A for-loop is a convenient way to step through an array.
Question 11
True/False
With arrays,indices start at any number the programmer chooses to indicate in the definition.
Question 12
True/False
Consider the array declaration,int x[20];.There is no memory allocated for x[20].
Question 13
Essay
Write a C++ code fragment that is assumed to be embedded in an otherwise complete and correct program.You are to assume the user has been prompted (so you don't have to)for (exactly)20 values of type int to be read from the keyboard,You are to use this input to fill an array.Do not write a full program,just the code fragment to do this.Do give declarations of the array and any variables you use.
Question 14
True/False
An array behaves like a list of variables each of which is of the same type and for which there is a uniform,convenient naming convention that can be declared in a single line of code.In the explanation,give an example of declaration and access.