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
sladkih [1.3K]
3 years ago
12

BOTH QUESTIONS ONLY FILL IN C++ CODEWrite a copy constructor for CarCounter that assigns origCarCounter.carCount to the construc

ted object's carCount. Sample output for the given program:Cars counted: 5Sample program:#include using namespace std;class CarCounter { public: CarCounter(); CarCounter(const CarCounter& origCarCounter); void SetCarCount(const int count) { carCount = count; } int GetCarCount() const { return carCount; } private: int carCount;};CarCounter::CarCounter() { carCount = 0; return;}// FIXME add copy constructorvoid CountPrinter(CarCounter carCntr) { cout << "Cars counted: " << carCntr.GetCarCount(); return;}int main() { CarCounter parkingLot; parkingLot.SetCarCount(5); CountPrinter(parkingLot); return 0;}QUESTION #2!!!!!!!!!!!!!!!!_______________----------------------------------------------_______________________________Overload the + operator as indicated. Sample output for the given program:First vacation: Days: 7, People: 3Second vacation: Days: 12, People: 3Sample program:#include using namespace std;class FamilyVacation{ public: void SetNumDays(int dayCount); void SetNumPeople(int peopleCount); void Print() const; FamilyVacation operator+(int moreDays) const; private: int numDays; int numPeople;};void FamilyVacation::SetNumDays(int dayCount) { numDays = dayCount; return;}void FamilyVacation::SetNumPeople(int peopleCount) { numPeople = peopleCount; return;}// FIXME: Overload + operator so can write newVacation = oldVacation + 5,// which adds 5 to numDays, while just copying numPeople. void FamilyVacation::Print() const { cout << "Days: " << numDays << ", People: " << numPeople << endl; return;}int main() { FamilyVacation firstVacation; FamilyVacation secondVacation; cout << "First vacation: "; firstVacation.SetNumDays(7); firstVacation.SetNumPeople(3); firstVacation.Print(); cout << "Second vacation: "; secondVacation = firstVacation + 5; secondVacation.Print(); return 0;}
Computers and Technology
1 answer:
Alborosie3 years ago
4 0

Answer:

im lost tell me a question then ill answer

Explanation:

You might be interested in
TCP and the User Datagram Protocol (UDP) provide _________ between processes on any two of those hosts. A. address translation B
Fynjy0 [20]

TCP is known to be a type of a connection-oriented protocol, while UDP is a connectionless protocol. TCP and UDP provide data transport between hosts.

  • TCP and UDP are known for their speed, as TCP is slower and can retransmit lost data packets than UDP. UDP is said to be faster, simpler, and efficient protocol.

Data transport is simply known to be an the energy problem. It is the amount of energy needed to transport a bit from the closest neighbor.

Data Transport Service gives  a reliable connection for moving large amounts of data at very fast speeds.

Learn more from

brainly.com/question/17695822

6 0
2 years ago
Pie charts are best used for
Anna11 [10]

Answer:B

Explanation:Showing parts of a whole.

4 0
3 years ago
Which of the following tasks is least effective at preventing a computer virus?
worty [1.4K]
Anti-virus software is set to scan your computer weekly is the least effective.
3 0
3 years ago
Read 2 more answers
Fill in the blank
melamori03 [73]

Explanation:

save as because if u want to save the bame of it press save as to save it as what u want

3 0
3 years ago
Read 2 more answers
Which of the following scenarios describes an IT professional using the Internet and computer system access in an unprofessional
pantera1 [17]

Answer:

All of the above

Explanation:

6 0
2 years ago
Other questions:
  • PLEASE HELP ASAP!!!!
    14·1 answer
  • Write three statements to print the first three elements of array runTimes. Follow each statement with a newline. Ex: If runTime
    12·1 answer
  • What is a good way to minimize technical problems with your computer
    10·1 answer
  • what tool can a student use to make sure his or her work paper does not take credit for someone else's work ?
    5·1 answer
  • When computing the cost of the basket of goods and services purchased by a typical consumer, which of the following changes from
    11·1 answer
  • What is the output after running the following code snippet? int number = 600; if (number &lt; 200) { System.out.println("Low sp
    15·1 answer
  • If your computer won't connect to the internet, which of these is most likely to be the problem?
    8·1 answer
  • You received an email message stating that your mother's bank account is going to be forfeited if you do not respond to the emai
    6·1 answer
  • Select the correct answer.
    5·1 answer
  • A user complains that the pointer movement on his laptop computer is very erratic what should you do?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!