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
What is one way to establish a team's velocity?
S_A_V [24]

Look at the average Story points completed from the last Iterations.

How To Improve Team Velocity?

Velocity cannot be used to compare teams, as all the teams are different. It also says nothing about how hard the team is working. Velocity is more about efficiency. Velocity should be treated as a team thing, not as an individual one. Some steps to improve team velocity are:

  • Care about team spirit
  • Set clear goals
  • Team members to work on one work at a time
  • Avoid unnecessary steps in the process
  • No micromanagement
  • Define The Process That Is Clear For Everyone
  • Keep Track Of Tech Debt. The team should regularly work on it, to avoid risks and quality problems in the future.
  • Focus On Quality, Not Speed. This will help to reduce the fixes, refactoring time, and increase productivity.
  • Do Not Load The Team Too Much.

To know more about Team Velocity, click on:

brainly.com/question/28174889

#SPJ1

8 0
1 year ago
Given a long integer representing a 10-digit phone number, output the area code, prefix, and line number using the format (800)
Alexxandr [17]

Answer:

See explanation!

Explanation:

Here we have a program written in C++ language. Each // symbol is a relative comment explaining the reason for each command line (and is not included during the program execution).

<em>The Program: </em>

#include <iostream>

<em>//c++ build in library</em>

using namespace std;

<em>//main code body starts here</em>

int main()

{

 <em> //declare variable to store phone numbers,its area code, prefix and line    number.</em>

  long pnumber;   <em>//declare long variable</em>

  int ac, prefix, lnumber;

 <em> //declare integer variables, where ac: Area Code and lnumber is the Line Number</em>

  cout<<"Enter a 10-digit Phone Number: "<<endl;

  <em>//cout command prints on screen the desired message</em>

  cin>>pnumber;

 <em> //cin command enables the user to interact with the programm and enter information manually</em>

 <em> //main body to obtain the desired output starts below</em>

<em>   //each 'division' is used to allocate the correct value at the correct </em>

<em>   //since prefix is used to get the desired output of ( )    -</em>

  ac = pnumber/10000000;

  prefix = (pnumber/10000)%1000;

  lnumber = pnumber%10000;

 <em> //main body ends here</em>

  cout<<"Based on your 10-digit number"<<endl;

  cout<<"below you have (AreaCode), Prefix, and - line number "<<endl;

  cout<<"("<<ac<<")"<<""<<prefix<<"-"<<lnumber<<endl;

 <em> //Prints on screen the desired output of the long 10 digit Number</em>

  return 0;<em> //ends program</em>

}

-------------------------------------------------------------------------------------------------------

<em>The Output Sample:</em>

Enter a 10-digit Phone Number:

8019004673

Based on your 10-digit number

below you have (Area Code), Prefix, and - line number

(801) 900-4673

<em>....Programm finished with exit code 0</em>

8 0
2 years ago
While your hands are on home row, your right hand rests lightly on _____.
ollegr [7]

Answer:

jkl;

Explanation:

6 0
3 years ago
An Accenture Technology team located in the US has added a new feature to an existing online ticketing platform. The team would
const2013 [10]

Answer:

Artificial intelligence

Explanation:

Artificial intelligence will help to receive real time feedback. Artificial intelligence can be explained as attempting to give computers the power to do those things for which human being needs intelligence. It is developing machines that think and work like humans.

Artificial intelligence can be used to get real time feedbacks and are useful for obtaining accurate insights. Artificial intelligence is accurately able to access performance and also give the right feedback

4 0
2 years ago
Your task is to design a method int[] allMatches(int[] values, int size, int a, int b) that returns all values between a and b i
iogann1982 [59]

The program that returns all values between a and b inclusive in the partially filled array values is illustrated below.

<h3>What is a program?</h3>

A computer program means a sequence or set of instructions that is in a programming language for a computer to execute.

Here, the program based on the information given will be:

count = 0

for each v in values

if a <= v <= b

 count++

result = new int[count]

i = 0

for each v in values

if a <= v <= b

 result[i] = v

 i++

return result

Java code:

public class ArrayRange {

public static int[] allMatches(int[] values, int size, int a, int b) {

 int count = 0;

 for (int i = 0; i < size; i++) {

  if(values[i] >= a && values[i] <= b) {

   count++;

  }

 }

 int result[] = new int[count];

 count = 0;

 for (int i = 0; i < size; i++) {

  if(values[i] >= a && values[i] <= b) {

   result[count++] = values[i];

  }

 }

 return result;

}

public static void main(String[] args) {

 int[] a = {11, 3, 9, 4, 2, 5, 4, 7, 6, 0};

 int[] returnedArray = allMatches(a, 8, 3, 7);

 for (int i = 0; i < returnedArray.length; i++) {

  System.out.print(returnedArray[i] + " "

Learn more about program on:

brainly.com/question/1538272

#SPJ1

5 0
2 years ago
Other questions:
  • What is something you can do to stay connected to the relationships in your life while we spend this time at home?
    13·1 answer
  • Give a recursive implementation for the function: def is_sorted(lst, low, high) This function is given a list of numbers, lst, a
    10·1 answer
  • Why hasn’t the World Health Organization declared a global health emergency?
    5·1 answer
  • Piecewise functions are sometimes useful when the relationship between a dependent and an independent variable cannot be adequat
    12·1 answer
  • What is a key function of a scrum master plato answer plz
    13·1 answer
  • PLEASE HELP ME HELP ME NO IM NOT OKAY AND ITS NOT EASY FOR ME.....Vladimir is reworking an old slideshow. He needs to delete som
    7·1 answer
  • 1 #include 2 3 int max2(int x, int y) { 4 int result = y; 5 if (x &gt; y) { 6 result = x; 7 } 8 return result; 9 } 10 11 int max
    12·1 answer
  • Expand and simplify the following expressions. 1/2 [ 2x + 2 ( x - 3)] *​
    10·1 answer
  • takes the perspective that a program describes what the solution to a problem is, not how that problem is solved. Select one: a.
    5·1 answer
  • [If you were the queen of the world .... What would you change ?]
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!