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]
3 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]3 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
What five safety habits are you using for the internet?
forsale [732]

Answer: Keep Personal Information Professional and Limited.

Keep Your Privacy Settings On.

Practice Safe Browsing.

Make Sure Your Internet Connection is Secure.

Be Careful What You Download.

Choose Strong Passwords.

Explanation:that’s what is think

4 0
2 years ago
When is an original work considered public domain?
Blababa [14]

The correct answer isn’t really a choice shown. I would choose D because if a work doesn’t have a copyright symbol that doesn’t mean it’s in the public domain. In a real life situation it would be best to ask the creator before you use their work. If they say it’s in the public domain then you’re fine, but even if they say you can use it that doesn’t mean it’s in the public domain, it just means that you have permission to use it.

7 0
2 years ago
How do you use loops in code?
Keith_Richards [23]

Answer:

A loop in a computer program is an instruction that repeats until a specified condition is reached. In a loop structure, the loop asks a question. If the answer requires action, it is executed. ... A computer programmer who needs to use the same lines of code many times in a program can use a loop to save time

Explanation:

4 0
3 years ago
The list below show test scores for 3rd period on a recent test.
Serhud [2]

Answer:

dshfjkahsdfkjhasdkjfasd

Explanation:

this is what u get for doing this to others foool

6 0
3 years ago
A ______ or workstation computer is typically used by one or a small number of people to perform everyday productivity tasks, su
sveta [45]

Answer:

Desktop

Explanation:

A desktop computer is a personal computing machine designed to be used on top of a usual office desk.

It accommodate in it the physical hardware that makes a computer run and connects to input devices like the mouse, monitor, and keyboard users interact with. Desktop computers are mostly used in enterprise and business environment, including in consumer use cases such as for gaming. In the enterprise, they are vital since they are the major medium for many users to do their day to day jobs.

6 0
3 years ago
Other questions:
  • Tanya has received an email, apparently from her bank, stating that some of her records were lost during server maintenance work
    13·2 answers
  • Which commas is used to combine two or more cells together into one cell
    11·1 answer
  • In regard to protective actions for explosive devices, the area where the blast originates is referred to as ___________ perimet
    8·1 answer
  • A page with no meaningful content that is full of ads and the webmaster makes money from if someone clicks on them is called____
    7·1 answer
  • The term "Cloud" refers to what option(s) below? (Select all that apply)
    13·1 answer
  • Answer for a, b, and c
    7·1 answer
  • Why, y did brainly just do that........or did it just happen to me
    12·2 answers
  • What is the value of creating recurring tasks?
    7·2 answers
  • ~ I already know this ~ who was the bits victim in five nights at freddys 4 <br> ___10 points___
    12·2 answers
  • In 1972, earlier designers built the
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!