Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 62 pages
Exam (elaborations)

CSE 240 EXAM 1 QUICK REVISION FLASHCARDS 2026

Document preview thumbnail
Preview 4 out of 62 pages

CSE 240 EXAM 1 QUICK REVISION FLASHCARDS 2026

Content preview

CSE 240 EXAM 1 QUICK REVISION
FLASHCARDS 2026

◉ What is the value in the variable Exam::total that is printed when
this program is executed?
#include<iostream>
using namespace std;


class Exam {
public:
static int total;
Exam() {
total++; }
};


int Exam::total = 0;


int main(){
Exam a, b, c;
Exam *d, *e, *f = new Exam;
cout << Exam::total;

,}.
Answer: 4


◉ a delete instruction is needed before the main() ends.
Which of the following options is correct?
#include<iostream>
using namespace std;


class MyClass {
public:
MyClass() {cout << "MyClass constructed\n";}
~MyClass() {cout << "MyClass destroyed\n";}
};
int main(){
MyClass * pt = new MyClass[3];
return 0;
}.
Answer: delete [ ] pt;


◉ The semantic structure of imperative programming languages
normally include which of the following validations

,parameters type in a function declaration should match these in the
function call.


division by zero


statement should end with a ';'


unicity


a variable name should start with a letter, '$' or '_'


type matching.
Answer: parameters type in a function declaration should match
these in the function call.


unicity


type matching


◉ The syntactical structure of the imperative programming
language reviewed in this course include which of the following
validations

, unicity


statement should end with a ';'


type matching


a variable name should start with a letter, '$' or '_'


division by zero


parameters type in a function declaration should match these in the
function call..
Answer: statement should end with a ';'


◉ Running the following program,
How many times the message "constructing" is printed on the
screen?


#include<iostream>
using namespace std;


class Rectangle {

Document information

Uploaded on
August 25, 2026
Number of pages
62
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$15.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.
TopGradeInsider
4.2
(13)
Sold
165
Followers
2
Items
55375
Last sold
11 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