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
HACTEHA [7]
4 years ago
7

There exists a data type Date with member function Increment that increments the current Date object by one. The ++ operator is

being overloaded to postincrement an object of type Date. Select the correct implementation:
1.Date Date::operator++( int ){Date temp = *this;Increment();return *temp;}2.Date Date::operator++( int ){Increment();Date temp = *this;return temp;}3.Date Date::operator++( int ){Date temp = *this;return this;temp.Increment();}4.Date Date::operator++( int ){Date temp = *this;Increment();return temp;}
Computers and Technology
1 answer:
nalin [4]4 years ago
3 0

Answer:

Date Date::operator++( int )

{

Date temp = *this;

Increment();

return temp;

}

Explanation:

Of options 1 through 4, only option 4 correctly implement the post increment of the ++ operator.

Interpreting each line of option for and comparing it to other options

Line 1: Date Date::operator++( int )

This declares the data type and its ++ operator

This is same for all options

Line 2: The Date type needs to be declared

In option 4, it was declared correctly as Date temp = *this;  using a pointer variable *this.

Here, option 2 is removed from the list of possible options.

Comparing other options

Line 3: The member increment option needs to be declared after the declaration of the date type variable.

This is correctly declared as Increment();  in option 4

Here, option 3 is removed from the list of possible options.

Comparing other options

Line 4: The value declared variable temp needs to be returned the way it was declared (without pointer indicator)

Hence, option 4 is best appropriate

You might be interested in
Whats the highest rank in brainly
vampirchik [111]

1. Beginner

2. Apprentice

3. Rising star

4. Helping Hand

5. Ambitious

6. Virtuoso

7. Expert

8. Ace

9. Genius

8 0
3 years ago
Read 2 more answers
Which statement is LEAST accurate? Select one: a. A common reason for ERP failure is that the ERP does not support one or more i
Fittoniya [83]

Answer:

d. To take full advantage of the ERP process, re-engineering will need to occur.

Explanation:

Justification:  

ERP Implementation: ERP gives a change in technological ways for managing resources, the way to run the business is remained same but now Ft becomes well planned Diversified P units of Mich do not share common process. and data, generally employ phased-in approach of implementing ERP

• It is the way to overcome from the risk which is with the big bang approach, direct switching

• Perfect implementation of ERP needs re-engineering on the basis of performance

a. maintenance Sometimes ERP which is installed could not support one of the business process. due to lack of research before selecting it

• The statement that the diversified organizations. not. implement ERPs is least accurate because they implement it by employing phased-in approach Therefore, the correct option is d

3 0
4 years ago
Which is the most important reason you should properly cite information that you obtain from an Internet search? Question 2 opti
Pepsi [2]
It is to avoid plagiarizing someone else's work
3 0
4 years ago
Before you enter an intersection on a green light make sure
mr Goodwill [35]

Answer:

there is no pedestrians and everyone is stopped at their designated red light

5 0
3 years ago
Read 2 more answers
Early photographers take to work with what in order to produce photographs? (Btw this is photography, it just isn't a subject in
Kruka [31]
1, they used to use chemicals.
4 0
3 years ago
Other questions:
  • Which statement correctly explains why televisions became less bulky?
    6·1 answer
  • Write a function with two parameters, prefix (a string, using the string class from ) and levels (an unsigned integer). The func
    14·1 answer
  • The process of sending ping requests to a series of devices or to the entire range of networked devices is called a:
    9·1 answer
  • What component is most likely to be installed in a PC, is considered primary storage, and typically stores the operating system,
    6·1 answer
  • Describe an algorithm that, given n integers in range 0 to k, preprocesses its input and then answers any query about how many o
    15·1 answer
  • You are the network adminstrator for your company your network consists of two active directory domains research.westsim.local a
    12·1 answer
  • My sister put my phone in the microwave and I'm pretty sure the battery blew up. I'm too scared to open the microwave. What do I
    11·1 answer
  • Which part of the Word application window should the user go to for the following activities?
    14·1 answer
  • 1) List two hardware methods that can be used to secure data
    11·1 answer
  • A blueprint or a "print" needs to
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!