subject

Challenge activity 7.5.1: Basic constructor definition.

Define a constructor as indicated. Sample output for below program:

Year: 0, VIN: -1
Year: 2009, VIN: 444555666#include using namespace std; class CarRecord { public: void SetYearMade(int originalYear); void SetVehicleIdNum(int vehIdNum); void Print() const; CarRecord(); private: int yearMade; int vehicleIdNum; }; // FIXME: Write constructor, initialize year to 0, vehicle ID num to -1. /* Your solution goes here */ void CarRecord::SetYearMade(int originalYear) { yearMade = originalYear; } void CarRecord::SetVehicleIdNum(int vehIdNum) { vehicleIdNum = vehIdNum; } void CarRecord::Print() const { cout << "Year: " << yearMade << ", VIN: " << vehicleIdNum << endl; } int main() { CarRecord familyCar; familyCar. Print(); familyCar. SetYearMade(2009); familyCar. SetVehicleIdNum(444555666); familyCar. Print(); return 0; }

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 14:00
In a file-oriented information system, a transaction file stores relatively permanent data about an entity is created and saved for backup and recovery purposes stores records that contain day-to-day business and operational data is a temporary file created by an information system for a single task
Answers: 3
question
Computers and Technology, 22.06.2019 06:30
Exchanging which type of data uses the least bandwidth? music photographs video voice bandwidth- the amount of data that can be moved between two points in a set time period
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Suppose an astronomer discovers a large, spherical-shaped body orbiting the sun. the body is composed mostly of rock, and there are no other bodies sharing its orbit. what is the best way to categorize this body? a. planet b. moon c. comet d. asteroid
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
You know the right answer?
Challenge activity 7.5.1: Basic constructor definition.

Define a constructor as indicate...
Questions
question
Mathematics, 24.08.2021 21:00
question
Mathematics, 24.08.2021 21:00
question
Mathematics, 24.08.2021 21:00
Questions on the website: 13722361