View the step-by-step solution to:

CSE202 HOMEWORK - 2 PART A 1. Can a class have static data members as well as static functions in a same program? Explain how?

please help me to find solution of this assignment.
CSE202 HOMEWORK – 2 PART A 1. Can a class have static data members as well as static functions in a same program? Explain how? 2. Mention three Characteristics of a static data member. 3. Find out errors a) # include<iostream.h> class abc { private: static int count; public: abc() { count=10; } void display() const { cout<<endl<<”count=” <<count; } }; void main() { abc a1,a2,a3; a1.display(); a2.display(); a3.display(); } b) # include<iostream.h> class example { private: int data; public: example(); void display()const; }; example::example() { data=0; } example::display()
Background image of page 1
{ cout<<endl<< ”count=” <<count; } void main() { example d; d.display(); } 4. WAP that defines a class complex (defining a complex number).Write a friend function that takes two argument of class complex and returns a complex number? PART B 5. How is dynamic initialization of objects achieved? 6. Distinguish between the following two statements Time T2(T1); Time T2=T1; 7. WAP to show the order of invocation of the constructor and destructor. 8. “Constructor and Destructor are the two sides of a coin”. Explain with an illustration.
Background image of page 2

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question