• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 17 pages
Exam (elaborations)

Asu Cse 240 Updated Actual Questions With Correct Answers

Document preview thumbnail
Preview 3 out of 17 pages

ASU CSE 240 UPDATED ACTUAL QUESTIONS WITH CORRECT ANSWERS

Content preview

ASU CSE 240 FINAL UPDATED ACTUAL
QUESTIONS WITH CORRECT ANSWERS


◉ Given the following definition and declarations:
#define size1 10
const int size2 = 20;
char a1[size1];
char a2[size2];
which line of code can cause a compilation error? Answer: char
a2[size2];


◉ Given the following snippet of code, answer the following two
questions based on the code:
typedef enum {Sun, Mon, Tue, Wed, Thu, Fri, Sat} days;
days x = Mon, y = Sat;
while (x != y) { x++; }
y++;
printf("x = %d, y = %d", x, y);


1. What value will be printed for variable x?
2. What value will be printed for variable y? Answer: 1. 6

,2. 7


◉ When is padding required for a structure type variable? Answer:
When the structure contains a word-type variable, such as integer, float,
and pointer, and the total number of bytes is not a multiple of four.


◉ The size (number of bytes) of a structure-type variable can be
changed by the following factors. Select all that apply.. Answer: -
changing the orders of the members in the structure.
-changing the computer from a 32-bit to a 64-bit processor.
-adding a member into the structure.


◉ What is the maximum number of padding bytes that a compiler can
add to a structure? Answer: more than 4


◉ Classes in C++ follow the same general syntax pattern as Structs,
Enums, etc.
<typename> <name>
{
<body>
};. Answer: True


◉ Which of these parts of RAM are automatically controlled by the
program/memory manager? Answer: -Stack

, -Static


◉ Select all that apply:
Identify the differences between a global variable and a static variable:
Answer: -Scope
-Static keyword


◉ What is true about Encapsulation in C++ vs. Java? Answer: -There is
no real difference in concept, just in Syntax. Visibility Modifiers are
categories instead of line-to-line keywords.
-Java technically has a 4th visibility modifier. When you don't put a
visibility modifier on a property or method it gets the "Default" modifier
which makes it partially private.


◉ If we don't use the Scope-Resolution Operator :: to define a method,
than C++ just thinks we're creating a function.. Answer: True


◉ When defining methods for a forward declared class, all the method
definitions MUST be in the same .cpp file.. Answer: False


◉ What's true about OOP in C++? Answer: -In C++ structs are fully
OOP but it changes the base assumption of visibility from private to
public
-"this" is a pointer in C++ and therefore we use -> to access from it

Document information

Uploaded on
September 30, 2026
Number of pages
17
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$17.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
FocusFile7
4.0
(29)
Sold
299
Followers
4
Items
76015
Last sold
7 hours ago



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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions