100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSCI 240 Final Exam Questions And Answers Rated 100% Correct!! $7.99   Add to cart

Exam (elaborations)

CSCI 240 Final Exam Questions And Answers Rated 100% Correct!!

 2 views  0 purchase
  • Course
  • CSCI 240
  • Institution
  • CSCI 240

The null terminator is __________. a. used to advance to a new line when executing a cout statement b. represented as '0' 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 s...

[Show more]

Preview 2 out of 13  pages

  • October 10, 2024
  • 13
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CSCI 240
  • CSCI 240
avatar-seller
ACADEMICMATERIALS
CSCI 240 Final Exam
The null terminator is __________.

a. used to advance to a new line when executing a cout statement
b. represented as '\0'
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 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.

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
d. thing - ✔️✔️c. object

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

a. true
b. false - ✔️✔️a. true


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

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


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;

a. H is now an alternate name for G
b. Adding 1 to H will change the value of G to 18
c. Subtracting 5 from G and printing H will display the value 12
d. The condition H == G will give a true result
e. All of the statements (a-d) are true - ✔️✔️e. All of the statements (a-d) are true

What will be displayed by the following code?

int main()
{
int num[5] = { 2, 4, 6, 8, 10 };
int i;

fn(num);

for( i = 0; i < 5; i++ )
cout << num[i] << ' ';

return 0;

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

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

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

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 ACADEMICMATERIALS. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

80630 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.99
  • (0)
  Add to cart