Monday, July 27, 2009

What is the source code in C++ of the below program?

C++ program in which you are required to define a class named Car. The class must include the following two data members.





// data member for Car Model


1: Model





//data member for Car Number


2: Number





Your Program should define three constructors for the class Car





1: a constructor with no parameter


2: a constructor with two parameters (model, number)


3: a copy constructor





All of these three constructors are meant to initialize their respective objects. Incase of copy constructor, you are required to assign a separate space for the data members of the new object while copying the values of previously existed object.





Declare three objects (1 for each type of constructor) in main.





Write a function in class Car to display the initialized data members for each object.





Also write destructor for the class Car. Display a message that says “destructor called” in the destructor body.





OUTPUT





Your output should be similar to the following





Suzuki


LWC123

What is the source code in C++ of the below program?
The only thing you forgot to include was the compensation package you are offering for this project - homey don't code for free no more, cuz I did my own homework, and got me a good job. If you are hoping to do the same, I suggest you do your own coding. If this is not a homework assignment, I apologize for my cynicism (but you still need to do your own coding)
Reply:Attempt your own homework, then ask for help. Don't you have tests you are worried about failing if you can't even write the constructors?

flower girl dresses

No comments:

Post a Comment