100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSC102 Final Exam Practice Questions and Answers Updated 2024 $12.49   Add to cart

Exam (elaborations)

CSC102 Final Exam Practice Questions and Answers Updated 2024

 1 view  0 purchase
  • Course
  • 2024/2025
  • Institution
  • 2024/2025

CSC102 Final Exam Practice Questions and Answers Updated 2024 Assignment and member selection are the only built-in operations on classes. - Answer-True Other operators cannot be applied directly to class objects. - Answer-True What does operator overloading do? - Answer-Extends definition of a...

[Show more]

Preview 3 out of 22  pages

  • October 16, 2024
  • 22
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • 2024/2025
  • 2024/2025
avatar-seller
Emillect
EMILLECT 2024/2025 ACADEMIC YEAR ©2024 EMILLECT. ALL RIGHTS RESERVED FIRST PUBLISH OCTOBER, 2024




CSC102 Final Exam Practice Questions
and Answers Updated 2024

Assignment and member selection are the only built-in operations on classes. - Answer✔✔-True


Other operators cannot be applied directly to class objects. - Answer✔✔-True


What does operator overloading do? - Answer✔✔-Extends definition of an operator to work

with user-defined data types.


C++ doesn't allow you to extend the definitions of most of the operators to work with the

classes. - Answer✔✔-False


What do templates do? - Answer✔✔-Enable you to write generic code for related functions and

classes


What are function templates used for? - Answer✔✔-To simplify function overloading


Existing operators can be overloaded to manipulate class objects. - Answer✔✔-True


You can create new operators. - Answer✔✔-False; only overload them.


What does the operator function do? - Answer✔✔-overloads an operator


Is operator a reserved word? - Answer✔✔-Yes


What is the function name to overload an operator ? - Answer✔✔-operator

Page 1/22

,EMILLECT 2024/2025 ACADEMIC YEAR ©2024 EMILLECT. ALL RIGHTS RESERVED FIRST PUBLISH OCTOBER, 2024


What is the general syntax of any operator function heading? - Answer✔✔-returnType

operator(operatorSymbol) (parameters)


Operator is a ______ returning function. - Answer✔✔-value


How do you overload an operator for a class? - Answer✔✔-1) Declare operator function in the

class definition 2) Write the definition of the operator function


Overloading of an operator can change precedence or associativity. - Answer✔✔-False; it is

fixed.


When overloading an operator, default parameters cannot be used. - Answer✔✔-True


When overloading an operator, you can change the number of parameters. - Answer✔✔-False


When overloading an operator, you cannot create new operators. - Answer✔✔-True


When overloading an operator, you cannot overload . .* :: ?: sizeof - Answer✔✔-True


Operators remain the same with built-in types. - Answer✔✔-True


Can overload for user-defined objects or for combination of user-defined and built-in objects. -

Answer✔✔-True


THIS pointer - Answer✔✔-Every object of a class maintains a hidden pointer to itself called THIS


What is the THIS pointer referenced by? - Answer✔✔-The member function




Page 2/22

, EMILLECT 2024/2025 ACADEMIC YEAR ©2024 EMILLECT. ALL RIGHTS RESERVED FIRST PUBLISH OCTOBER, 2024


What is a FRIEND function of a class? - Answer✔✔-a nonmember function of the class that has

access to all members of the class. (Friends have all the benefits of knowing you, but aren't a

family member)


FRIEND is a reserved word. - Answer✔✔-True


In which definition is FRIEND used? - Answer✔✔-Class definition, but not function.


To overload a unary operator for a class: If the operator function is a member of the class, how

many parameters does it have? - Answer✔✔-none


To overload a unary operator for a class: If the operator function is a nonmember, how many

parameters does it have? - Answer✔✔-one


Binary arithmetic operator + can be overloaded either as a member or nonmember function. -

Answer✔✔-True


As a member function, operator + has direct access to data members of one of the objects, so

how many objects need to be passed as a parameter? - Answer✔✔-Only one


As a nonmember function, how many objects must be passed for operator +? - Answer✔✔-Both


The assignment operator copies _______________________ from one object to another.

Doesn't work well with _____________________________. - Answer✔✔-Member variables;

object; pointer member variables


Classes with pointer member variables must.. - Answer✔✔-1. Explicitly overload the assignment

operator

Page 3/22

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

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

76799 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
$12.49
  • (0)
  Add to cart