COSC 1436 EXAM 3 UPDATED Questions and CORRECT Answers
3 views 0 purchase
Course
COSC 1436
Institution
COSC 1436
COSC 1436 EXAM 3 UPDATED Questions
and CORRECT Answers
True/False: A local variable and a global variable may not have the same name within the
same program. - CORRECT ANSWER- false
This statement causes a function to end. - CORRECT ANSWER- to return
These types of arguments are passed to pa...
COSC 1436 EXAM 3 UPDATED Questions
and CORRECT Answers
True/False: A local variable and a global variable may not have the same name within the
same program. - CORRECT ANSWER✔✔- false
This statement causes a function to end. - CORRECT ANSWER✔✔- to return
These types of arguments are passed to parameters automatically if no argument is provided
in the function call. - CORRECT ANSWER✔✔- default
A(n) ________ search uses a loop to sequentially step through an array. - CORRECT
ANSWER✔✔- linear
True/False: The amount of memory used by an array depends upon the array's data type and
the number of elements in the array. - CORRECT ANSWER✔✔- true
True/False: Using a binary search, you are more likely to find an item than if you use a linear
search. - CORRECT ANSWER✔✔- false
Which of the following is a valid C++ array definition? - CORRECT ANSWER✔✔- int
scores[10];
A(n) ________ is information that is passed to a function, and a(n) ________ is information
that is received by a function. - CORRECT ANSWER✔✔- arguemtn, parameters
An array can store a group of values, but the values must be: - CORRECT ANSWER✔✔-
same data type
Using a linear search to find a value that is stored in the last element of an array of 20,000
elements, ________ element(s) must be compared. - CORRECT ANSWER✔✔- 20,000
, Which statement correctly uses C++ 11 to initialize a vector of ints named n with the values
10 and 20? - CORRECT ANSWER✔✔- vector <int> n{10,20};
By using the same ________ you can build relationships between data stored in two or more
arrays. - CORRECT ANSWER✔✔- subscript
True/False: One reason for using functions is to break programs into manageable units, or
modules. - CORRECT ANSWER✔✔- True
When used as parameters, these types of variables allow a function to access the parameter's
original argument. - CORRECT ANSWER✔✔- reference
The ________ sort usually performs fewer exchanges than the ________ sort. - CORRECT
ANSWER✔✔- selection bubble
True/False: C++ limits the number of array dimensions to two. - CORRECT ANSWER✔✔-
false
________ algorithms are used to arrange random data into some order. - CORRECT
ANSWER✔✔- sorting
True/False: A parameter is a special-purpose variable that is declared inside the parentheses
of a function definition. - CORRECT ANSWER✔✔- false
An array of string objects that will hold 5 names would be declared using which statement? -
CORRECT ANSWER✔✔- string names[5];
True/False: Before you can perform a bubble sort, the data must be stored in descending
order. - CORRECT ANSWER✔✔- false
Unlike regular variables, these can hold multiple values. - CORRECT ANSWER✔✔- arrays
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller MGRADES. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $11.49. You're not tied to anything after your purchase.