shrek c++

#include <iostream>

// Step 1: Define a class named 'Shrek'
class Shrek {
public:
    // Step 2: Declare member variables for Shrek's characteristics
    std::string name;
    int age;
    std::string occupation;

    // Step 3: Declare a member function to display Shrek's information
    void displayInfo() {
        std::cout << "Name: " << name << std::endl;
        std::cout << "Age: " << age << std::endl;
        std::cout << "Occupation: " << occupation << std::endl;
    }
};

int main() {
    // Step 4: Create an instance of the Shrek class
    Shrek shrekInstance;

    // Step 5: Set values for Shrek's characteristics
    shrekInstance.name = "Shrek";
    shrekInstance.age = 35;
    shrekInstance.occupation = "Ogre";

    // Step 6: Call the displayInfo function to show Shrek's information
    shrekInstance.displayInfo();

    // Step 7: Return 0 to indicate successful execution
    return 0;
}