Question
Vehicle Class
Create a class named Vehicle with private data members to store:
Vehicle ID, Registration Number, Model, Manufacturer, Year of Manufacture, Fuel Type Include appropriate constructors and member functions.
Answer :
Word Count : 976
___ ___ _________ _______ _________ ______ __________ _____ ____.
________ _________ ___ _______ ________ ____.
____ _________ __________ _________ ____ ______ ______ ___ ____ ______ _______ _________.
__________ ______ __________ _____ ______ ___.
___ _______ __________ ______ _______ _______ ______ _________.
____ ______ _____ ______ ________ _____ _____ ____ _____ __________.
___ ______ _______ ____ _____ ___ ________ _______ ________ ___ ________ _________.
_______ __________ _______ _______ ________ ___.
_______ ________ ________ ____ __________.
_______ ____ __________ _________ __________ ___ _________ ________ ___ ____ ________ __________.
______ _________ _______ ___ _________ ________.
__________ _____ __________ ___ __________ ___ _______ ______ _____.
__________ __________ _______ ____ ________ _________ _________.
__________ ________ ____ ____ _______ ___.
_______ _______ ________ ____ ______ ________.
______ _____ _______ _________ ___ ________ _________ _________ ________ _______ ______.
____ __________ ___ __________ ____ ________ ___ ___.
____ __________ __________ _________ ____ ______ _______.
________ _______ __________ ______ _______ _________ ______ ______ _____ ______ ___.
______ __________ _________ ___ ___.
______ ______ ______ ____ _______ _________ ______ ____ ________ _______.
_______ _____ __________ ___ _________ ________ ______ _______ ___ ____ ____.
____ ___ __________ ______ _____.
____ ___ _______ _____ _____ ______ _________ __________ _______ __________ ___ __________.
___ ______ _______ __________ _____ _______ ____.
__________ _____ ___ ___ _________ _________ ____ __________ _____ ____.
_____ ___ _____ _______ _______ _________ ___ ______ ______.
_________ ____ _____ ______ _________ ____ _______ ____.
______ _______ ______ _________ ________ ____ ____.
_______ __________ _________ ______ ___.
____ ____ _____ _______ ________ ______ __________ ____ ____.
____ ______ _____ __________ _________ ___ _________ ___.
________ __________ _______ ____ ____.
________ _______ ______ _____ _____ ______ ______ _________ _______ __________ _________.
__________ ____ _______ _______ __________ ______ ____.
_________ _______ ________ ______ _________ _______.
_______ __________ ___ _________ _________ _______ ___ _____ ________ ___.
_________ _______ ____ _____ _________ ___ _________ _________.
__________ ____ _________ _______ ____ _______ ____ ____.
____ ________ ____ ______ _______ ____.
____ ________ _________ __________ __________ ___ _____ __________ ______.
_____ _____ ____ _________ ________ _____ ________ _______ _______.
____ ________ _________ _____ ________ _____ __________ ______.
___ _________ ______ ___ __________ _____ _________.
_____ _________ _________ ___ __________ _____ _____ _____ ______.
____ ___ __________ ________ __________ _____.
________ ___ ______ ________ ___ __________ ___ _________ ______ ___ __________.
________ ___ ____ ____ _____ ______ ______.
______ ________ ______ ____ _________ ________ _________ ________ ________ ____.
_______ ______ ____ _______ _________ __________ __________ ___ _______ ___ ________.
_____ _____ ________ ______ _______ ______.
_________ _________ _____ ____ __________ _________ ______ _______ ________.
_______ _________ _________ ___ _________.
____ ____ _____ _________ ___ ________ ___.
_________ ___ ___ ____ _____ ______ ______ _______ ______.
_____ _____ ____ _________ _______ __________.
_________ ___ _________ _____ ____ ___ ___ ___ ______ ______.
_________ ____ ____ _____ ______.
_________ __________ ____ ___ _______ _______ ______ _______ _______ __________.
______ ________ __________ ___ _________ _____ ___.
____ ___ ____ ____ ___ _____ ___ _______ ______ _____ ________.
_________ _________ ____ _______ ________ ______ ____ ____ _______.
__________ __________ _____ ____ _______ _____ __________ ________.
__________ _____ ______ _______ ____ _________ _____ _______ _____ __________ __________ ______.
________ _________ ______ ___ ___ _____ ______ ______ ____.
___ __________ ____ _____ ________ _____ _________ ___.
____ ___ _______ _____ __________ _____ ___ _______.
_____ _____ _______ ___ ________ ___.
___ _____ _______ ____ _____ ______ ________ ____ ____ _______.
___ ______ _________ ___ ___ ___ ____ ___ _______ ______.
____ _________ __________ _________ ________ __________.
_______ _________ ______ _____ ______ ___ ___ __________ ___ ____ __________ ______.
___ __________ ________ _______ ________ ______ _________ ___ ___ ________ _____ ___.
_____ ______ __________ ____ _____ ______ __________ _________.
___ _______ ______ _____ ____ _________ _______ ________ ____.
__________ ______ ____ ___ _______ ___ ___ ___ ______ ______ _____ ________.
___ _______ __________ ___ ________ ______ ______ _______ ______ _________ ___ ______.
__________ ____ ____ _______ ______ __________.
______ _________ ________ __________ ___ _______ ___ __________ ______ ___.
________ ________ ____ ______ _______ _______ _________ _______.
_______ _____ ____ _____ _________ ____ _____.
_______ ______ ____ _____ _____ ____ ______ ______ _____ ___.
_______ _______ ________ _________ _________.
_______ ____ _________ ________ ______ ________ __________ _____ _____ ________ ____.
____ ______ ____ ________ ______ ____ ____ _________ ________ _______.
_____ ____ _______ ________ ___ ______ _______ ______.
______ _________ _____ ____ _____ _________ ___ _________ _________ __________.
_______ ___ ________.
Skip in 10
A class in C++ is a user-defined data type that combines data members and member functions into a single unit. In a DBMS and C++ Lab, a `Vehicle` class can be used to represent the details of a vehicle in an organized manner. The class should contain private data members for Vehicle ID, Registration Number, Model, Manufacturer, Year of Manufacture, and Fuel Type. Making these members private provides data security because they cannot be accessed or modified directly from outside the class. Instead, public member functions can be used to initialize, display, and modify the vehicle information. The following C++ program creates a `Vehicle` class with the required private data members and appropriate constructors and member functions: ```cpp #include #include using namespace std; class Vehicle { private: int VEHICLE_ID; string REGISTRATION_NUMBER; string MODEL; string MANUFACTURER; int YEAR_OF_MANUFACTURE; string FUEL_TYPE; public: // Default constructor Vehicle() { VEHICLE_ID = 0; REGISTRATION_NUMBER = ""; MODEL = ""; MANUFACTURER = ""; YEAR_OF_MANUFACTURE = 0; FUEL_TYPE = ""; } // Parameterized constructor Vehicle(int id, string registrationNumber, string model, string manufacturer, int year, string fuelType) { VEHICLE_ID = id; REGISTRATION_NUMBER = registrationNumber; MODEL = model; MANUFACTURER = manufacturer; YEAR_OF_MANUFACTURE = year; FUEL_TYPE = fuelType; } // Function to set vehicle details void setVehicleDetails(int id, string registrationNumber, string model, string manufacturer, int year, string fuelType) { VEHICLE_ID = id; REGISTRATION_NUMBER = registrationNumber; MODEL = model; MANUFACTURER = manufacturer; YEAR_OF_MANUFACTURE
__________ _______ ____ ______ ___ _____ _________.___ ___ _________ _______ _________ ______ __________ _____ ____.
________ _________ ___ _______ ________ ____.
____ _________ __________ _________ ____ ______ ______ ___ ____ ______ _______ _________.
__________ ______ __________ _____ ______ ___.
___ _______ __________ ______ _______ _______ ______ _________.
____ ______ _____ ______ ________ _____ _____ ____ _____ __________.
___ ______ _______ ____ _____ ___ ________ _______ ________ ___ ________ _________.
_______ __________ _______ _______ ________ ___.
_______ ________ ________ ____ __________.
_______ ____ __________ _________ __________ ___ _________ ________ ___ ____ ________ __________.
______ _________ _______ ___ _________ ________.
__________ _____ __________ ___ __________ ___ _______ ______ _____.
__________ __________ _______ ____ ________ _________ _________.
__________ ________ ____ ____ _______ ___.
_______ _______ ________ ____ ______ ________.
______ _____ _______ _________ ___ ________ _________ _________ ________ _______ ______.
____ __________ ___ __________ ____ ________ ___ ___.
____ __________ __________ _________ ____ ______ _______.
________ _______ __________ ______ _______ _________ ______ ______ _____ ______ ___.
______ __________ _________ ___ ___.
______ ______ ______ ____ _______ _________ ______ ____ ________ _______.
_______ _____ __________ ___ _________ ________ ______ _______ ___ ____ ____.
____ ___ __________ ______ _____.
____ ___ _______ _____ _____ ______ _________ __________ _______ __________ ___ __________.
___ ______ _______ __________ _____ _______ ____.
__________ _____ ___ ___ _________ _________ ____ __________ _____ ____.
_____ ___ _____ _______ _______ _________ ___ ______ ______.
_________ ____ _____ ______ _________ ____ _______ ____.
______ _______ ______ _________ ________ ____ ____.
_______ __________ _________ ______ ___.
____ ____ _____ _______ ________ ______ __________ ____ ____.
____ ______ _____ __________ _________ ___ _________ ___.
________ __________ _______ ____ ____.
________ _______ ______ _____ _____ ______ ______ _________ _______ __________ _________.
__________ ____ _______ _______ __________ ______ ____.
_________ _______ ________ ______ _________ _______.
_______ __________ ___ _________ _________ _______ ___ _____ ________ ___.
_________ _______ ____ _____ _________ ___ _________ _________.
__________ ____ _________ _______ ____ _______ ____ ____.
____ ________ ____ ______ _______ ____.
____ ________ _________ __________ __________ ___ _____ __________ ______.
_____ _____ ____ _________ ________ _____ ________ _______ _______.
____ ________ _________ _____ ________ _____ __________ ______.
___ _________ ______ ___ __________ _____ _________.
_____ _________ _________ ___ __________ _____ _____ _____ ______.
____ ___ __________ ________ __________ _____.
________ ___ ______ ________ ___ __________ ___ _________ ______ ___ __________.
________ ___ ____ ____ _____ ______ ______.
______ ________ ______ ____ _________ ________ _________ ________ ________ ____.
_______ ______ ____ _______ _________ __________ __________ ___ _______ ___ ________.
_____ _____ ________ ______ _______ ______.
_________ _________ _____ ____ __________ _________ ______ _______ ________.
_______ _________ _________ ___ _________.
____ ____ _____ _________ ___ ________ ___.
_________ ___ ___ ____ _____ ______ ______ _______ ______.
_____ _____ ____ _________ _______ __________.
_________ ___ _________ _____ ____ ___ ___ ___ ______ ______.
_________ ____ ____ _____ ______.
_________ __________ ____ ___ _______ _______ ______ _______ _______ __________.
______ ________ __________ ___ _________ _____ ___.
____ ___ ____ ____ ___ _____ ___ _______ ______ _____ ________.
_________ _________ ____ _______ ________ ______ ____ ____ _______.
__________ __________ _____ ____ _______ _____ __________ ________.
__________ _____ ______ _______ ____ _________ _____ _______ _____ __________ __________ ______.
________ _________ ______ ___ ___ _____ ______ ______ ____.
___ __________ ____ _____ ________ _____ _________ ___.
____ ___ _______ _____ __________ _____ ___ _______.
_____ _____ _______ ___ ________ ___.
___ _____ _______ ____ _____ ______ ________ ____ ____ _______.
___ ______ _________ ___ ___ ___ ____ ___ _______ ______.
____ _________ __________ _________ ________ __________.
_______ _________ ______ _____ ______ ___ ___ __________ ___ ____ __________ ______.
___ __________ ________ _______ ________ ______ _________ ___ ___ ________ _____ ___.
_____ ______ __________ ____ _____ ______ __________ _________.
___ _______ ______ _____ ____ _________ _______ ________ ____.
__________ ______ ____ ___ _______ ___ ___ ___ ______ ______ _____ ________.
___ _______ __________ ___ ________ ______ ______ _______ ______ _________ ___ ______.
__________ ____ ____ _______ ______ __________.
______ _________ ________ __________ ___ _______ ___ __________ ______ ___.
________ ________ ____ ______ _______ _______ _________ _______.
_______ _____ ____ _____ _________ ____ _____.
_______ ______ ____ _____ _____ ____ ______ ______ _____ ___.
_______ _______ ________ _________ _________.
_______ ____ _________ ________ ______ ________ __________ _____ _____ ________ ____.
____ ______ ____ ________ ______ ____ ____ _________ ________ _______.
_____ ____ _______ ________ ___ ______ _______ ______.
______ _________ _____ ____ _____ _________ ___ _________ _________ __________.
_______ ___ ________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.