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
Dropdown Complete the sentence. To protect a web-based database, you should apply to any online forms that add data to it. princ
sergey [27]

To protect a web-based database, you should apply <u>principle of least privilege</u> to any online forms that add data to it.

<h3>What is principle of least privilege?</h3>

Principle of least privilege is also referred to as the principle of minimal privilege (least authority) and it can be defined as a security concept that involves giving an end user, software program, or process the minimum levels of access or permissions necessary to perform an action in a database.

In this context, a network administrator should apply the <u>principle </u><u>of least </u><u>privilege</u> to any online forms that add data to a web-based database, in order to protect it.

Read more on least privilege here: brainly.com/question/4365850

3 0
3 years ago
Read 2 more answers
Productivity, rework, and technology impact are examples of which kind of software metric?
fgiga [73]

The correct answer should be process type of software metric. The process metrics are used to help in strategic decision making. The processes such as work products delivery, expended human hours and conformance to quality and schedule are all metrics in the process domain.

6 0
3 years ago
Janet needs to flag a message for follow-up in Outlook. Which option is not a default?
kari74 [83]
Answer:

Explanation:

Today
5 0
3 years ago
Read 2 more answers
A time line may identify cause or effect of an event?<br> True or False?
levacccp [35]
True whenever you look at one it helps identify the cause/effect of an event
3 0
3 years ago
3) Write the example of LAN.​
Aleks [24]

Networking at home, Networking in an office, networking between two computers.

6 0
2 years ago
Read 2 more answers
Other questions:
  • Which pane displays commands that change relative to the activity taking place in the presentation window's main work area?
    15·1 answer
  • What is the primary purpose of a business plan? To file for incorporation To help you identify your goals and plan how you will
    6·1 answer
  • When using a graphics editing program, which option allows you to adjust the space around an image?
    15·1 answer
  • Keisha wants to change the font color on the 1st and 3rd bullet items on slide 6 of her allied health presentation. what is the
    14·1 answer
  • Renee's creating a plan for her business's information system. What should she do after she determines the goals for her busines
    10·1 answer
  • What is the purpose of citations?
    13·1 answer
  • What does a shutter speed of one mean?
    14·2 answers
  • _______and ________ enables computers to communicate and it can pass information between two networks.
    15·1 answer
  • Debug the program so it prints the factorial of a positive integer entered by the user. This is calculated by multiplying all th
    9·1 answer
  • True or False: VLANs in cloud computing are most likely to be found on direct connections with a CSP.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!