subject

Write a c++ program in which ypu are required to define a
classnamed "citizen" .
the class must include thefollowing two data members
//data member for
citizenname
1: name
//data member for
citizennatioanlity
2: nationality
your program should define three constructors for the
class"citizen"
1) a constructor with "noparameters"
2) a constructor with "twoparameters"
(name, nationality)
3) a "copyconstructor"
all of these three constrcutors are meant to initialize
theirrespective objects. in case of copy constructor, you are
requiredto assign a separate space for the data members of the new
objectwhile copying the values of previously existed object.
declare "three
objects"(1 for each type of constructor) in the "main"function
write a function in class "citizen" to
display the initialized datamembers for each object.
also write "destructor"for the
class "citizen" .
dispaly a message that says"destructorcalled"
in the destructor body.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:00
Designing a mobile web page is a little different from designing a regular web page. name at least three features that should be considered when designing a website that is mobile phone-friendly, and briefly explain why they are important.
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
When designing content as part of your content marketing strategy, what does the "think" stage represent in the "see, think, do, care" framework?
Answers: 3
question
Computers and Technology, 22.06.2019 22:00
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag.e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
question
Computers and Technology, 23.06.2019 18:40
Johnson enterprises uses a computer to handle its sales invoices. lately, business has been so good that it takes an extra 3 hours per night, plus every third saturday, to keep up with the volume of sales invoices. management is considering updating its computer with a faster model that would eliminate all of the overtime processing.
Answers: 2
You know the right answer?
Write a c++ program in which ypu are required to define a
classnamed "citizen" .
the cla...
Questions
question
Mathematics, 23.03.2021 03:40
question
Mathematics, 23.03.2021 03:40
question
World Languages, 23.03.2021 03:40
question
Mathematics, 23.03.2021 03:40
Questions on the website: 13722361