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
12. What are the additional elements required of a network architecture if the enclave is to support remote access through the p
Romashka [77]

The additional elements needed of a network architecture are:

  • Policy management
  • Remote access server
  • VPN Gateway, etc.

<h3>What is network architecture example?</h3>

Network architecture is known to be the set up of a computer network. It is regarded as the backbone for the specification of the physical attributes of a network and also their functional configuration.

An examples is a printer that is linked to the network. Note that  additional elements required of a network architecture if the enclave is to support remote access through the public Internet are Policy management, etc.

Learn more about network architecture from

brainly.com/question/13986781

6 0
2 years ago
your browsing the internet and realize your browser is not responding. which of the following will allow you to immediately exit
Mandarinka [93]

Answer:

Task Manager is the answer

8 0
3 years ago
Add three methods to the Student class that compare twoStudent objects. One method (__eq__) should test for equality. A second m
shusha [124]

Answer:

class Student(object):

def __init__(self, name, number):

self.name = name

self.scores = []

for count in range(number):

self.scores.append(0)

 

def getName(self):

 

return self.name

 

def setScore(self, i, score):

 

self.scores[i - 1] = score

 

def getScore(self, i):

 

return self.scores[i - 1]

 

def getAverage(self):

 

return sum(self.scores) / len(self._scores)

 

def getHighScore(self):

 

return max(self.scores)

def __eq__(self,student):

return self.name == student.name

 

def __ge__(self,student):

return self.name == student.name or self.name>student.name

 

def __lt__(self,student):

return self.name<student.name

 

def __str__(self):

return "Name: " + self.name + "\nScores: " + \

" ".join(map(str, self.scores))

 

 

def main():

student = Student("Ken", 5)

print(student)

for i in range(1, 6):

student.setScore(i, 100)

print(student)

 

print("\nSecond student")

student2 = Student("Ken", 5)

print(student2)

 

print("\nThird student")

student3 = Student("Amit", 5)

print(student3)

 

print("\nChecking equal student1 and student 2")

print(student.__eq__(student2))

 

print("\nChecking equal student1 and student 3")

print(student.__eq__(student3))

 

print("\nChecking greater than equal student1 and student 3")

print(student.__ge__(student3))

 

print("\nChecking less than student1 and student 3")

print(student.__lt__(student3))

if __name__ == "__main__":

5 0
3 years ago
1. It is one way to attain one's holistic health condition.​
suter [353]

Answer:

It focuses on complete human body condition rather than single parts. The person should be healthy in all dimensions.

Explanation:

Holistic health condition is an ancient approach to a healthy life. This is a study where human is considered as healthy if he has no illness plus he is able to interact with others. he healthy condition depicts mind, soul and body. The health conditions are based on dimensions rather than single body function.

3 0
2 years ago
Which Azure service should you use to correlate events from multiple resources into a centralized repository?
Trava [24]

Answer:

D. Azure Log Analytics

Explanation:

The Azure service we can use when you have to correlate events from more than 1 sources into a repository which is centralized you have to use Azure Log Analytics.

it is a special surrounding for Azure monitor log data.Each workspace has their own repository and configuration.

Hence we conclude that the answer to this question is option D Azure Log Analytics.

6 0
3 years ago
Other questions:
  • What is the purpose for the refresh button?
    10·2 answers
  • What are issues to consider when deciding to build software in-house or purchase commercial off-the-shelf software (cots)?
    14·1 answer
  • You are manually configuring a tcp/ip host. another administrator gives you the router's ip address. what is the tcp/ip term for
    6·2 answers
  • What could be one rule to help your friend to blog safely
    6·2 answers
  • Rick works for the government and is investigating a small business that the government suspects has been cheating on its taxes.
    15·1 answer
  • A(n) is the tool that will help you the most when developing the content you will use in your presentation.
    10·1 answer
  • What animal is perry the platypus ​
    6·2 answers
  • Classify the various scenarios in a web development team that is creating a website for a client according to the priority level
    9·1 answer
  • All cells in row 2 through 5 are referred as 2:5 true or false
    10·1 answer
  • Computer are most wonderful creation of 21st century how ?​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!