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
Exam (elaborations)

CSCI 240 Final Exam Questions and Correct Answers

Rating
-
Sold
-
Pages
35
Grade
A+
Uploaded on
02-02-2026
Written in
2025/2026

This document contains CSCI 240 final exam questions with correct verified answers. Topics include C++ programming fundamentals, classes and objects, functions and prototypes, arrays, strings, pointers and references, control structures, loops, operators, data types, and program logic. Suitable for exam revision, coursework, and computer science study.

Show more Read less
Institution
CSCI 240
Course
CSCI 240

Content preview

1 | P a g e | © copyright 2024/2025 | Grade A+




CSCI 240 Final Exam Questions and
Correct Verified Answers Latest
Version
The class X contains two data members: an integer called xVal and a float

called xPerc. Which of the following is NOT a valid prototype for the class

definition for X?




a. void X( int, float );


b. void setxVal( int );


c. float getxPerc();


d. X( int, float );


e. void printX();


 a. void X( int, float );




An instance of a class is known as a/an .




a. variable


b. method


c. object


Master01 | September, 2024/2025 | Latest update

, 1 | P a g e | © copyright 2024/2025 | Grade A+

d. thing


 c. object




The :: operator is used to associate a method with a specific class.




a. true


b. false


 a. true




Which of the following statements (a-d) about classes is true?




a. A class can contain both data members and methods


b. The members of a class may be private or public


c. The name of the constructor is always the same as the name of the class


d. The class definition contains prototype statements for the methods


e. All of the statements (a-d) are true.


 e. All of the statements (a-d) are true.




If a string will need room for 25 characters, how should it be defined so that it

will be a valid string?

Master01 | September, 2024/2025 | Latest update

, 1 | P a g e | © copyright 2024/2025 | Grade A+




a. char str[25];


b. char str[24];


c. char str[26];


d. char str[];


 c. char str[26];




Which of the following string functions will ALWAYS produce a valid string after

execution?




a. strcpy


b. strcat


c. Both of the functions (a-b) will produce a valid string


 c. Both of the functions (a-b) will produce a valid string




The null terminator is .




a. used to advance to a new line when executing a cout statement


b. represented as '\0'



Master01 | September, 2024/2025 | Latest update

, 1 | P a g e | © copyright 2024/2025 | Grade A+

c. used to end a valid string


d. a movie starring Arnold Schwarzenegger


e. All of the statements (a-d) are correct


f. Only statements b and c are correct


 f. Only statements b and c are correct.




Which of the following is the correct definition for a variable called dblRef that

can hold a reference to the double variable dblNum?




a. double dblRef = dblNum;


b. double *dblRef = &dblNum;


c. double &dblRef = dblNum;


d. double &dblRef;


 c. double &dblRef = dblNum;




Which of the following statements (a-d) are true if the following lines of code

are executed?




int G = 17;


int &H = G;

Master01 | September, 2024/2025 | Latest update

Written for

Institution
CSCI 240
Course
CSCI 240

Document information

Uploaded on
February 2, 2026
Number of pages
35
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$18.49
Get access to the full document:

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

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.
Lynemayer stuvia
View profile
Follow You need to be logged in order to follow users or courses
Sold
68
Member since
1 year
Number of followers
3
Documents
1372
Last sold
2 weeks ago
pure test banks

All documents are crafted with clarity, accuracy, and a deep understanding of course requirements. Clear, organized, and easy to follow Based on real lectures, textbooks, and past exams Trusted by students worldwide Instant download — study smarter today! Whether you're prepping for finals or need a quick refresher, there's something here to support your success. Browse the collection and find exactly what you need to ace your courses!

Read more Read less
3.1

11 reviews

5
4
4
1
3
2
2
0
1
4

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