Question

Use appropriate constructors to initialize objects and demonstrate the use of both default and parameterized constructors in your program. Make assumptions, if necessary

07 Aug 2026
Answer :
Word Count : 989
Constructors are special member functions of a C++ class that are automatically invoked when an object of the class is created. They are mainly used to initialize the data members of an object. A constructor has the same name as the class and does not have a return type, not even `void`. C++ supports different types of constructors, among which default and parameterized constructors are commonly used. A default constructor initializes an object without receiving any arguments, whereas a parameterized constructor receives arguments and initializes an object with specific values. The following C++ program demonstrates the use of both default and parameterized constructors. The program assumes a `Student` class containing three data members: student name, roll number, and marks. ```cpp #include #include using namespace std; class Student { private: string name; int rollNo; float marks; public: // Default constructor Student() { name = "Unknown"; rollNo = 0; marks = 0.0; } // Parameterized constructor Student(string n, int r, float m) { name ________ ______ ___ ________ ___ __________.
________ ___ _______ ___ ___ __________ ______.
___ ___ ________ _______ ______ ___ ________ ________ _______ _____.
__________ ___ ___ ___ __________ _____ ___ __________ __________ __________ ________.
______ __________ _________ ______ ______ ___ _________ ____ ______ ___.
__________ ____ ___ _________ ___ _________ _______ ________.
_______ _________ ________ _____ _____ _________.
___ ____ ______ _____ _______ ____ _______ _____ ___.
_________ ____ _________ ____ ____ __________ ___ _________ _____.
______ _______ ___ ________ ___ _________ ____ _____ _________ ________ ________.
_____ __________ ____ _____ ___ ___.
______ _______ ___ ____ ____ __________.
__________ _______ __________ _______ ________ _______ ___.
_______ _______ ____ ___ _____ ______ ______.
______ ______ _______ ________ ___.
_____ ___ _______ _________ ________ _____.
___ ______ _________ _____ _______ ________ _________ ______.
_________ _______ _______ ________ __________ ________ __________ ____ _______ __________ ____.
______ __________ ____ ___ ___ __________ _________ ________ ____ ___ _______ _____.
____ _________ _____ ____ ______ __________ ________ ______ ________.
____ ______ ___ ________ _____ _______ _______ __________ _____ ________.
______ ______ _________ ___ _____ _________ _________ __________ __________ ___.
____ ______ __________ ______ ____ ___ _________ ___ __________ ____ _____ ___.
______ ___ ______ _______ _____ _____ ________ ___ _________ __________ __________ ___.
____ ____ ____ ___ _____ ______ ___ ____ ______ ______ _________.
____ __________ _______ ________ _____ _______ _____ ___ ___ ____ _________.
_____ _____ ____ ________ ____ __________.
_______ ______ ____ ________ ________ _______ ______ __________ ______ _______.
_________ ____ _________ ______ _________ _________ ____ ________ ___ _________.
___ ______ _________ _______ _________ ____ _________ _______ ______.
__________ ___ ______ ___ ______ ___ _______.
________ ______ _____ ___ __________ _________ _________ _________ _______ __________ ______ ______.
____ ________ ___ ___ ________ _________.
______ ____ _____ _______ ______ ______ ________.
________ __________ __________ ___ ______ __________ ______ _________ ____ ___ __________.
_______ ____ ________ _______ ________.
________ ________ _______ ___ _____.
_____ ____ ____ _________ ______ ___ _______ ______ ____ ___ ________.
___ _________ __________ ________ _______ _____ __________ _________ ______ _____ ________.
___ ________ ________ _____ _____ _____ ______ _______ ______ ___.
_______ ______ ______ ________ _________.
_________ _______ _____ ____ _________ _________ ________ _____ __________ _______ _____ __________.
_______ ____ _________ ___ _______ ___.
__________ _______ _______ ______ _________ __________ __________ ______ __________ ______ _________ __________.
____ _____ _____ _________ __________ _________ ______ ________ ____ _______ ____.
_________ _________ _____ _________ ________ ______ _______ ________ _________.
_____ _____ ______ _________ __________ ______ __________ ____ ______ __________ _______.
___ __________ _________ ____ _____.
___ _____ __________ _____ _____ ___ _________ ____ ____ ____.
_____ ________ _______ ____ __________ _________ ________ ________ ___.
____ ________ _________ _______ _______ ______ _______ _____ _________ ___ _______ ____.
___ _______ _______ ____ _______ ____.
_______ ______ ________ ____ __________ __________ ________ ____ ________ ________ ____.
_______ _____ ________ _____ _______ _______ ____ __________ _______.
______ ____ ____ ___ ________ _____ ______.
__________ ___ _________ ___ _________ ________ _______ _____ ______ ________ ______ _____.
____ _____ __________ __________ ____ _________ ____ ___.
__________ ________ _________ ___ ______ __________ __________ _________.
__________ _________ ______ _____ ________.
______ ____ ________ _______ _______ ____ ___ ____ _______ ___ _________.
_____ _______ _____ ______ _________ ___ _____ ____ ________ _______ ____.
___ _________ _____ ______ ________ ___.
___ _______ ___ _______ ________ _______ ________ ________ ___ _____ ___.
_________ ___ __________ ___ _______ ____ ________ ____ _____ ______.
__________ ___ _________ _____ ____ ______ ____ __________ ________ ______ _______ ____.
___ ___ __________ _______ ___ __________ __________ ____.
_______ _______ ____ _______ ____ ____ ________ ____.
_____ ______ ________ ______ _______ ____ ________ ____ ___ _________ __________.
_______ ___ ____ _________ _______ ___ ___ _______ ____ __________.
______ ____ ______ _______ ______ ___ _____ _____ _____ _____ ______.
__________ __________ ________ ______ ________ _______.
_____ ______ _______ _________ _______ ______ _______ _______ ________.
____ __________ ___ __________ _________ ___ ____ ____.
____ _______ _______ __________ ____ _______ _________ __________ __________ ________.
________ ________ __________ ______ ______ _____ ____ ___ ____ ___ _______ ____.
_____ ______ ______ ____ _________.
________ __________ __________ ________ _________ ________.
________ ______ _________ __________ ____ __________.
______ ______ _________ ___ __________.
____ __________ _____ ______ ____ ___ ____ __________ _________ ___ _________.
_____ __________ _____ _________ __________ ________ ________ ______ ______.
__________ __________ ____ ___ ___.
________ _______ ___ __________ _____.
__________ _____ ____ ____ ____ ________ _________.
____ __________ _______ _________ _______ ___ _______ ___ _______.
_________ ___ _____ _____ __________ ______ _______ ___ _________ _________ _____ _______.
_______ ______ _______ ______ ___ ____ ___ _________.
__________ __________ _______ _________ _________ ____ __________ _______ ________ __________ __________ ________.
_____ __________ _____ ________ ______ ____.
_______ _____ ______ ____ _________ ___ _______ _______ _______ _________ _______.
__________ ________ _____ __________ ______.
________ __________ _____ _____ ______.
____ _____ __________ __________ ________ _______ _______ ______ _______.
______ ____ _______ ___ ________ ___ ___ ___ _________ ______ ____ _________.
_________ ________ _________ _________ ___.
Get Full Answer on WhatsApp
IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Use appropriate constructors to initialize objects and demonstrate the
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→