100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

CSE 240 Final ACTUAL UPDATED Exam Questions and CORRECT Answers

Rating
-
Sold
-
Pages
12
Grade
A+
Uploaded on
20-08-2025
Written in
2025/2026

CSE 240 Final ACTUAL UPDATED Exam Questions and CORRECT Answers What is the key difference between a static variable and a global variable? A) They come from different parts of memory, or B) They have different visibility. - CORRECT ANSWER - B What operations will acquire memory from heap? (declaration, free, malloc, new) - CORRECT ANSWER - malloc, new If a function calls another function, the local variables in these two functions use the memory from (different, the same) stack frame(s). - CORRECT ANSWER - different

Show more Read less
Institution
CSE 240
Course
CSE 240









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CSE 240
Course
CSE 240

Document information

Uploaded on
August 20, 2025
Number of pages
12
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

CSE 240 Final ACTUAL UPDATED Exam
Questions and CORRECT Answers
What is the key difference between a static variable and a global variable? A) They come from
different parts of memory, or B) They have different visibility. - CORRECT ANSWER - B


What operations will acquire memory from heap? (declaration, free, malloc, new) - CORRECT
ANSWER - malloc, new


If a function calls another function, the local variables in these two functions use the memory
from (different, the same) stack frame(s). - CORRECT ANSWER - different


What is the best way to delete an array created by "p = new StructType[size];" in C++? -
CORRECT ANSWER - delete[] p;


What memory must be garbage collected by a destructor? (_____ memory created by _____ (in
the same, outside) the class) - CORRECT ANSWER - heap, constructors, in the same


Java programmers do not need to do garbage collection because Java A) does not use heap
memory, or B) uses a system program to collect garbage. - CORRECT ANSWER - B


What is the best way of deleting a linked list of objects in C++? A) head = 0; or B) Use a loop to
delete every object in the linked list. - CORRECT ANSWER - B


If A is the base class and B is a class derived from A, then class A) A becomes a member in class
B, or B) B has all the members of class A. - CORRECT ANSWER - B


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?
- CORRECT ANSWER - yes

, The semantics of multiple inheritance becomes complex and error prone, if the base classes have
(members with different names, overlapped members). - CORRECT ANSWER - overlapped
members


If you want to create a linked list of Container nodes, which can contain Publication node, Book
node, Thesis node, and Report node, what type of pointer should be declared in the Container to
point to all these nodes? [A pointer to (Book, Publication) node] - CORRECT ANSWER -
Publication


Defining a virtual function in class means that the function A) can be redefined in its child
classes, or B) is an interface only and not allowed implementation. - CORRECT ANSWER -
A


Given the following class definition and the variable declaration:


class employee
char *name;
long id;
}
class manager {
employee empl;
char* rank;
}x


How do you set an x's employee's ID to 12345? - CORRECT ANSWER - x.empl.id = 12345;


If the relation between two C++ classes can be best described as "has-a" relation, we should A)
contain one class in the other (containment), or B) derive one class from the other (inheritance). -
CORRECT ANSWER - A

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
MGRADES Stanford University
View profile
Follow You need to be logged in order to follow users or courses
Sold
1067
Member since
1 year
Number of followers
102
Documents
68976
Last sold
15 hours ago
MGRADES (Stanford Top Brains)

Welcome to MGRADES Exams, practices and Study materials Just think of me as the plug you will refer to your friends Me and my team will always make sure you get the best value from the exams markets. I offer the best study and exam materials for a wide range of courses and units. Make your study sessions more efficient and effective. Dive in and discover all you need to excel in your academic journey!

3.8

168 reviews

5
73
4
30
3
43
2
8
1
14

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions