1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mkey [24]
3 years ago
8

5)What are the differences in the function calls between the four member functions of the Shape class below?void Shape::member(S

hape s1, Shape s2);void Shape::member(Shape *s1, Shape *s2);void Shape::member(Shape& s1, Shape& s2) const;void Shape::member(const Shape& s1, const Shape& s2);void Shape::member(const Shape& s1, const Shape& s2) const;
Computers and Technology
1 answer:
Stells [14]3 years ago
5 0

Answer:

void Shape :: member ( Shape s1, Shape s2 ) ; // pass by value

void Shape :: member ( Shape *s1, Shape *s2 ) ; // pass by pointer

void Shape :: member ( Shape& s1, Shape& s2 ) const ; // pass by reference

void Shape :: member ( const Shape& s1, const Shape& s2 ) ; // pass by const reference

void Shape :: member ( const Shape& s1, const Shape& s2 ) const ; // plus the function is const

Explanation:

void Shape :: member ( Shape s1, Shape s2 ) ; // pass by value

The s1 and s2 objects are passed by value as there is no * or & sign with them. If any change is made to s1 or s2 object, there will not be any change to the original object.

void Shape :: member ( Shape *s1, Shape *s2 ) ; // pass by pointer

The s1 and s2 objects are passed by pointer as there is a * sign and not & sign with them. If any change is made to s1 or s2 object, there will be a change to the original object.

void Shape :: member ( Shape& s1, Shape& s2 ) const ; // pass by reference

The s1 and s2 objects are passed by reference  as there is a & sign and not * sign with them. If any change is made to s1 or s2 object.

void Shape :: member ( const Shape& s1, const Shape& s2 ) ; // pass by const reference

The s1 and s2 objects are passed by reference  as there is a & sign and not * sign with them. The major change is the usage of const keyword here. Const keyword restricts us so we cannot make any change to s1 or s2 object.

void Shape :: member ( const Shape& s1, const Shape& s2 ) const ; // plus the function is const

The s1 and s2 objects are passed by reference  as there is a & sign and not * sign with them. const keyword restricts us so we cannot make any change to s1 or s2 object as well as the Shape function itself.

You might be interested in
What types of storage can be used to access your data on a another computer
vladimir1956 [14]
1. Cloud Storage, such as dropbox or Google drive,
2. Network attached storage, where all your data is stored on a central NAS, and you can access it in Windows explorer or Mac Finder
3 Data on flash drive or on an external hard drive.
3 0
3 years ago
What translates binary data into images on a monitor?
g100num [7]
A video card is what allows a computer to translate the binary data into images.
8 0
3 years ago
The process known as "bitmapping" is defined as information in _____. <br><br> finish the sentence.
valentina_108 [34]

graphics is the answer

4 0
2 years ago
PLEASE GET THE RIGHT ANSWERS AND HELP MEEE
Afina-wow [57]

Answer: #1 is A

Explanation: Parents often monitor what their child is doing online because online activities can be threatening and sometimes dangerous to a child's life, depending on what they come across on the web. just a hunch

4 0
2 years ago
Read 2 more answers
The second phase of the writing process is when you draft your message. Choose the appropriate step in the drafting phase to com
Kamila [148]

Answer: a. Proofreading

Explanation:

Proofreading is an important part in the publication process. In this the carefully all the contents of the text are thoroughly read and errors are rectified and corrected like formatting issues, spelling mistakes, grammatical errors, inconsistencies, punctuation mistakes, and other mistakes are checked. Without proofreading no writing should be published.

According to the given situation, proofreading is the part of the revision process of the writing. This is done when the writing part is completed and the content is sent for electronic printing before electronic printing thorough revision of the content is required.

6 0
3 years ago
Read 2 more answers
Other questions:
  • what is it called when you are biying and selling products via electronic channels such as the internet​
    13·2 answers
  • A user makes a request to implement a patch management service for a company. As part of the requisition the user needs to provi
    7·1 answer
  • Brad Smith works for GHI Firm. GHI firm is a registered Broker-Dealer in State A, B and C and a registered IA in State A. Brad i
    10·1 answer
  • How to control what is on the x and y axis in excel?
    13·1 answer
  • Create a view named Top10PaidInvoices that returns three columns for each vendor: VendorName, LastInvoice (the most recent invoi
    12·1 answer
  • When using correct ergonomic technique be sure to _____.
    11·2 answers
  • Old systems can be useful when designing new computer software.<br> True or False
    7·2 answers
  • ¿como la imagen organiza la realidad?
    13·1 answer
  • Why does a crane need to rotate/swivel​
    9·1 answer
  • Meta is a penetration testing engineer assigned to pen test the security firm's network. So far, she cannot tunnel through the n
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!