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
Candace opened an email from a person she didn't know and clicked on a pop-up in the email that installed a virus on her compute
Minchanka [31]

Answer:

Shut down the computer.

Explanation:

l hope it help

4 0
3 years ago
Read 2 more answers
Ruth designs games for mobile operating systems such as iOS and Windows. The demand for games on mobile devices is high. Ruth’s
VMariaS [17]

Answer:

Viper Slash can be classified as a Question mark product

Explanation:

BCG matrix is a method developed by the Boston Consulting Group to analyze the strategic position and potential of businesses or products.

Business portfolios are evaluated using

  1. Relative market share
  2. Market growth rate

The result of the analysis is divided into four quadrants

  1. Dogs
  2. Cash cows
  3. stars and
  4. question marks

  1. Dogs: This comprises of business portfolios that operate in a slow-growing market. Investing in businesses in this quadrant is not advised due to their poor cash returns.
  2. Cash cows: These include business portfolios that provide high cash returns and should be milked.
  3. Stars: These are business portfolios that are operating in a fast-growing market and possess very high prospects of becoming cash cows.
  4. Question marks: are business portfolios that are underdogs in fast growing markets, they consume much cash but still, incurred losses. They don't gain many market shares despite high investments and have great tendencies to become dogs.

Ruth's Viper Slash falls into the Question marks category as the games section is a fast-growing market and struggle to gain market shares.

6 0
3 years ago
How do you turn on the Track Changes feature in a spreadsheet?
myrzilka [38]
I would "turn on" this track changer as I would usually go to the top left corner, where it would say edit, and then, usually, as you look down at the bottom, you would then see where it would then be a switch that would say "turn on" or "turn off" track changer.
4 0
4 years ago
Write a program that reads an integer, and then prints the sum of the even and odd integers.
Tasya [4]

Answer:

#include <iostream>  // header file

using namespace std;  // namespace

int main ()

{

int n, x1, i=0,odd_Sum = 0, even_Sum = 0;  // variable declaration

cout << "Enter the number of terms you want: ";

 cin >> n;  // user input the terms

cout << "Enter your values:" << endl;

  while (i<n)  // iterating over the loop

{

cin >> x1;  // input the value

if(x1 % 2 == 0)  // check if number is even

{

even_Sum = even_Sum+x1;  // calculate sum of even number

}

else

{

odd_Sum += x1; // calculate sum of odd number.

}

i++;

}

cout << "Sum of Even Numbers is: " << even_Sum << endl;  // display the sum of even number

cout << "Sum of Odd Numbers is: " << odd_Sum << endl;  // display the sum of odd number

return 0;

}

Output:

Enter the number of terms you want:3

Enter your values:2

1

78

Sum of Even Numbers is:80

Sum of Odd Numbers is:1

Explanation:

In this program we enter the number of terms by user .After that iterating over the loop less then the number of terms .

Taking input from user in loop and check the condition of even. If condition is true then adding the sum of even number otherwise adding the sum of odd number.

Finally print the the sum of the even number and odd integers.

6 0
3 years ago
I need help please!!!!
MissTica
Just restart it and it will be fixed
5 0
3 years ago
Read 2 more answers
Other questions:
  • Need answers for 11&amp;12. Due today. Thanks.
    14·1 answer
  • Select the correct answer. Ryan received an email from a person claiming that he is an employee of the bank in which Ryan has a
    11·2 answers
  • The total revenues for a company are $150,223 and the total expenses were 125,766. If you are calculating the net income, which
    10·1 answer
  • Which practice is the best option for desktop security? A. Make a unique user ID and password for each account. B. Change the pa
    9·2 answers
  • Consider the following concurrent tasks, in which each assignment statement executes atomically. Within a task, the statements o
    9·1 answer
  • 10. Realice un algoritmo que solicite números y los sume, solo se detendrá cuando se ingrese un número negativo.
    10·1 answer
  • After reading through the code, what will happen when you click run?​
    13·1 answer
  • Write two statements that each use malloc to allocate an int location for each pointer. Sample output for given program:
    7·1 answer
  • One of the difficult things about working in game design is that while there are many different roles, most of them only match o
    15·1 answer
  • Why are digital signals an accurate and reliable way to record and send information?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!