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
Your new home has a vacuum system. what kind of computer is controlling it?
Scrat [10]
The answer is embedded computer. It is a PC framework with a committed capacity inside a bigger mechanical or electrical framework, frequently with ongoing figuring constraints. It is implanted as a component of a total gadget regularly including equipment and mechanical parts. Installed frameworks control numerous gadgets in like manner utilize today.
6 0
3 years ago
Write a for loop that iterates from 1 to numbersamples to double any element's value in datasamples that is less than minvalue.
CaHeK987 [17]

Answer:

function dataSamples=AdjustMinValue(numberSamples, userSamples, minValue)

dataSamples=userSamples;

%for loop

for i=1:numberSamples

%checking if dataSamples value at index,i

%is less than minValue

if dataSamples(i)<minValue

%set double of dataSamples value

dataSamples(i)= 2*dataSamples(i);

end

end

end

Explanation:

The given code is in MATLAB.

4 0
3 years ago
Copy the skeleton of code below into your answer. Then in the space indicated, add your own code to prompt the user for two numb
ahrayia [7]

Answer:

import java.util.*;

public class Main

{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

   

 System.out.print("Enter the first: ");

 int first = input.nextInt();

 System.out.print("Enter the second: ");

 int second = input.nextInt();

 input.nextLine();

 System.out.print("Enter your name: ");

 String name = input.nextLine();

 

 int difference = Math.abs(second - first);

 

 System.out.println(name + ", the difference is " + difference);

}

}

Explanation:

*The code is in Java.

Create a Scanner object to get input from the user

Ask the user to enter the first, second, and name

Calculate the difference, subtract the second from the first and then get the absolute value of the result by using Math.abs() method

Print the name and the difference as in required format

7 0
2 years ago
Phân tích cạnh tranh của cocacola và pepsi
Fittoniya [83]
I don’t understand please speak English
7 0
2 years ago
at the bank there is 4 lines with 7 costumers and there are five customers left over. how many customers are there​
mrs_skeptik [129]
Answer: 33
7 times 4 is 28 add the left over 5 makes 33 people
4 0
2 years ago
Other questions:
  • What is an independent data mart?
    8·1 answer
  • What do you click on to minimize all open windows? the Show Desktop icon the Start menu the system tray the taskbar
    15·2 answers
  • Jason is creating a web page for his school's basketball team. He just finished creating his storyboard. Which tool should he us
    6·2 answers
  • True / False<br> The exponent in floating point is stored as a biased value.
    9·1 answer
  • A parent is browsing through a shopping website, looking for blue-colored striped socks for her child. She is fine if the socks
    15·1 answer
  • When specifying keywords to conduct an internet search, which of the following parts of speech will be the most useful??
    6·1 answer
  • Courses that enable students to begin jobs that require course completion certificates are know as
    8·1 answer
  • How can we display outputs of DIR one screenful at a time? There are at least two different ways, and either one is acceptable.
    8·1 answer
  • ¿porque y como surge la informatica y las computadoras
    13·1 answer
  • You are going to create an Arduino sketch where you have two push buttons, one piezo, one
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!