CSE240 - FINAL EXAM QUESTIONS AND ANSWERS WITH COMPLETE SOLUTIONS VERIFIED GRADED A++
1 view 0 purchase
Course
CSE240
Institution
CSE240
CSE240 - FINAL EXAM QUESTIONS AND ANSWERS WITH COMPLETE SOLUTIONS VERIFIED GRADED A++
In an array-implemented queue class, what members should be declared as "public" members?
queue_size
the array of buffer
front and rear index variables
enqueue and dequeue functions
enqueue and dequeue fun...
In an array-implemented queue class, what members should be declared as
"public" members?
queue_size
the array of buffer
front and rear index variables
enqueue and dequeue functions
enqueue and dequeue functions
The purpose of the scope resolution operator is to allow a function to be -
implemented using recursion.
placed inside the class.
placed outside the class.
a global function.
placed outside the class.
What are the key features of object orientation in programming languages? Select
all that apply
Dynamic memory allocation
Encapsulation of state
How is Java's garbage collection implemented?
It uses a reference counter to indicate if an object is still referenced by any variable.
,If a function calls another function, the local variables in these two functions use
the memory from?
different stack frames.
same stack frames.
static
heap
different stack frames.
Given the snippet of code:
int x = 7;
int bar(int j) {
int *k = 0, a = 6;k = &a;
return (j+a);
}
void main(void) {
static int i =0;
i++;
i = bar(i) + x; }
Which variables obtain their memory from the stack? Select all that apply
i
j
k
a
x
, j, k, a
What is the best way of deleting a linked list of objects in C++?
Use a loop to delete every object in the linked list.
What is the best way of deleting an array created by "p = new StructType[size];"
in C++?
delete[] p;
What members of a base class can be redefined in the derived classes?
virtual members
In the implementation of the getMax() function in the PriQueue class, we need to
read and write the variables "front" and "rear", which are defined as protected
members in the base class Queue. Are the functions in the derived class allowed
to access the protected members in the base class?
yes, always
If a class needs to inherit from multiple parent classes, the parent classes must?
a)not contain overlapped members.
b)be defined as interface classes only.
c)contain virtual functions only.
d)be inherited as virtual classes.
If A is the base class and B is a class derived from A, and x and y are pointers to
objects of A and B, respectively, which assignment statement can pass the
compiler check?
x=y;
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 LIXAN. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $10.49. You're not tied to anything after your purchase.