Advanced Inheritance & Polymorphism - example with Array of Objects (in-depth Data Structures & OOP)

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ก.ย. 2024

ความคิดเห็น • 48

  • @CodeBeauty
    @CodeBeauty  ปีที่แล้ว +18

    📚 Learn programming with these Free E-Books ⬇
    C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
    Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
    🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
    Experience the power of practical learning, gain career-ready skills, and start building real applications!
    This is a step-by-step course designed to take you from beginner to expert in no time!
    💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
    Use it quickly, because it will be available for a limited time.
    Code:
    #include
    #include
    using namespace std;
    class Student {
    public:
    string Name;
    int Age;
    char Gender;
    virtual void study() = 0;// a pure virtual method
    };
    class ProgrammingStudent : public Student {
    void study() {
    cout

    • @SenioritaAlaa
      @SenioritaAlaa ปีที่แล้ว

      i have question here,
      how can i use destructor to deleted those objects here??

  • @thrice5560
    @thrice5560 ปีที่แล้ว +5

    hi

  • @pedrolobo9835
    @pedrolobo9835 ปีที่แล้ว +5

    Hi, can you please make a video about Lybiscovist Substitution Principle? This is deeply related to this topic.

  • @chupacabra1899
    @chupacabra1899 11 หลายเดือนก่อน

    hey saldina can you talk about class composition vs class inheritance??

  • @christopherrice891
    @christopherrice891 ปีที่แล้ว +14

    I thought English was Saldina's native language. What IS her native language then🤔?

    • @purveshsane1435
      @purveshsane1435 ปีที่แล้ว +2

      Bosnian I think. I’ve noticed that younger people in ex Yugoslav countries tend to speak English pretty well though. But obviously it will be noticeable to native speakers (like myself) that it’s not their first language.

  • @Sam-k1i2i
    @Sam-k1i2i ปีที่แล้ว +14

    hey there Saldina, your video seriously helped me wrap my head around complex programming topics such as this one, just wanted to say thank you

  • @dexianchen7778
    @dexianchen7778 ปีที่แล้ว +14

    Thank you for the excellent content!

  • @MilesGerome
    @MilesGerome ปีที่แล้ว +14

    can't thank you enough for this video, you are truly empowering me on my coding journey. Fantastic instructor

  • @deanmorrison6254
    @deanmorrison6254 ปีที่แล้ว +11

    just wanted to drop a quick shoutout for your video, your teaching style rocks, many thanks

  • @amelccc
    @amelccc ปีที่แล้ว +16

    standing ovation for this video, your effort in simplifying these concepts deserves a big round of applause

  • @dundyd3612
    @dundyd3612 ปีที่แล้ว +15

    You're an excellent teacher, and have a great gift to explain these complex topics so well. I admire you even more now that I know English is not your native language!

  • @codeoasis1180
    @codeoasis1180 ปีที่แล้ว +14

    your breakdown of arrays of objects, along with insights into polymorphism and inheritance, has given me a solid grasp on these topics, thank you Saldina

  • @diegopereira524
    @diegopereira524 ปีที่แล้ว +4

    Hola Saldina también se puede considerar usar un poco el standard de C++ algo asi std::vector combinado con las interfase separadas de la clase Student del ejemplo.
    Ver:
    #include
    #include
    #include
    using namespace std;
    /// Part of library study() ///
    class IStudy {
    public:
    virtual void study() = 0;
    };
    void print( vector &vecStudent ){
    for( auto &student : vecStudent){
    student->study();
    }
    }
    /// Fin library ///
    class Student{
    public:
    string Name;
    int Age;
    char Gender;
    Student() : Name{}, Age{0}, Gender{' '}{
    cout

  • @lamienali8467
    @lamienali8467 ปีที่แล้ว +5

    Could you possibly delve into the use of different scripting languages like Python and C++ to create a login page?

  • @anwar6971
    @anwar6971 ปีที่แล้ว +5

    Thanks, watching all these series of videos related to array of objects

  • @lamienali8467
    @lamienali8467 ปีที่แล้ว +6

    Thank you for this insightful lesson your coding videos are incredibly valuable for learners like me.

  • @milkamilkica1935
    @milkamilkica1935 ปีที่แล้ว +5

    excelent explanation as always, thank you Saldina

  • @hilgicamala2520
    @hilgicamala2520 ปีที่แล้ว +3

    great content Saldina, superb explanation, thx

  • @andriy_bondarenko
    @andriy_bondarenko ปีที่แล้ว +1

    // This is my funny program to study abstract classes
    #include
    #include
    using std::cout;
    const int tempo = 500;
    const int camerton = 220;
    void Performance(int notes, float* pitch, int* duration)
    {
    for (int i = 0; i < notes; i++)
    Beep((camerton * pow(2, pitch[i] / 12)), duration[i] * tempo);
    }
    class Instrument
    {
    protected:
    int notes;
    float* pitch;
    int* duration;
    public:
    virtual void Play() = 0;
    };
    class Piano : public Instrument
    {
    public:
    Piano()
    {
    notes = 7;
    duration = new int[notes] { 1, 1, 1, 1, 1, 1, 2 };
    pitch = new float[notes] { 5, 5, 12, 12, 14, 14, 12 };
    }
    void Play() override
    {
    cout

  • @PinkyPowers
    @PinkyPowers 9 หลายเดือนก่อน +2

    This challenge was awesome fun!
    Mine is broken up into 8 different files (prototype header and body cpp files for each class), but here is how the main() looks, and what prints out in console:
    #include
    #include "monster.h"
    #include "dragon.h"
    #include "werewolf.h"
    #include "zombie.h"
    int main(){
    Monster* monsters[3];
    monsters[0] = new Dragon("Smaug", "Reddish Gold", 50);
    monsters[1] = new Werewolf("Fenrir", "Ash Grey", 10);
    monsters[2] = new Zombie("Dwight", "Pale", 6);
    for (int i = 0; i < 3; i++){
    std::coutprintMonster();
    monsters[i]->move();
    monsters[i]->intimidate();
    monsters[i]->attack();
    std::cout

    • @CodeBeauty
      @CodeBeauty  9 หลายเดือนก่อน +1

      🚀✨️✨️

  • @srikanthreddy9330
    @srikanthreddy9330 7 หลายเดือนก่อน

    @CodeBeauty
    Need the videos of the c++ in a sequential manner which include indepth concept and also the 10hr course of entire c++ is not including every concept you explained.
    Please provide the sequence of each and every indepth concepts of c++>

  • @salihbarknakkaya8101
    @salihbarknakkaya8101 6 หลายเดือนก่อน

    Well it is done. I watched all of the oop lessons here. It was totally a masterpiece. I will do more practice and in a few days I will start data structures playlist in your channel. (maybe pointers as well) Thanks for the all cool informations, It was the best so far I have ever seen, u r great!

  • @OzzFan1000
    @OzzFan1000 ปีที่แล้ว +2

    Excellent explanation on inheritance and polymorphism! Thank you so much.

  • @l.p.1967
    @l.p.1967 ปีที่แล้ว +2

    i wish there is more instructors like you, thanks

  • @chupacabra1899
    @chupacabra1899 10 หลายเดือนก่อน

    hey saldina at the end of your video you didn't say student[i] = nullptr; i think in a video of yours you said it was a good practice

  • @banglarif
    @banglarif ปีที่แล้ว

    Waiting for your course to make C++ as my native language. I can understand it takes time to make a best course. But still very hungry for that..... :)

  • @dwivedys
    @dwivedys 4 หลายเดือนก่อน

    After we have deleted the dynamic memory taken up by the three objects - don’t we also need to delete the array students of pointers to the objects?

  • @locngothis
    @locngothis 3 หลายเดือนก่อน +1

    new => wheww

  • @santhrupthik2287
    @santhrupthik2287 7 หลายเดือนก่อน

    which coding language is used throughout your practical programming course???

  • @AshaRASHA-sv7nq
    @AshaRASHA-sv7nq ปีที่แล้ว +1

    Hello saldina, could you please explain opengl and STL in c++ , BTW i just love your teaching skills its Brillant 😍

  • @nv9usb381
    @nv9usb381 ปีที่แล้ว +2

    just what i needed, thank you Saldina

  • @ertemeren
    @ertemeren 10 หลายเดือนก่อน

    Hi Saldina. Do you have a separete video about composition?

  • @ATAG-yn5pd
    @ATAG-yn5pd 3 หลายเดือนก่อน

    Don't we need a virtual destructor in the base class?

  • @kateranksheavenmanagement
    @kateranksheavenmanagement ปีที่แล้ว

    Please could you teach me how to build a webbrowser with tabs in it

  • @gollygobih6527
    @gollygobih6527 ปีที่แล้ว +1

    superb content, even better explanation

  • @JeffRyman69
    @JeffRyman69 ปีที่แล้ว

    Sometime I would like to see you comment on why you like object-oriented programming. I have seen several videos critical of OOP but I don't have the experience to intelligently comment on their viewpoint. I am a retired research engineer with programming experience in imperative programming using machine and assembly language on early computers, and later with FORTRAN, some C, and a touch of BASIC. I had a single class in C++ over 20 years ago but changed jobs to a non-programming environment so I never got a chance to use it. I will note that modern Fortran standards have now incorporated some OOP capabilities, so I am interested in seeing if those capabilities might be useful.

  • @harrisonzuletamontoya4615
    @harrisonzuletamontoya4615 8 หลายเดือนก่อน

    seriously thanks for the videos and all what you've done, I'm studying with all the lists of c++, I have learned all what a I know from you, thank you

  • @hassanalmasri3935
    @hassanalmasri3935 ปีที่แล้ว

    Please ma'am, i need help
    I want to learn OpenGL and i need to link the glfw and glut libraries in order to continue but i am using vsCode and i tried lot's of things on the internet but nth worked.
    Please can you help me ?

  • @580HexShank
    @580HexShank ปีที่แล้ว

    Your videos are filled with highly inspirational and generous instructions. Thank You Saldina Thank You. You’re by far the best most legendary C++ instructor I’ve ever met over the internet. Be well Saldina. Peace and Blessings through our Blessed Mother.

  • @mamun3192
    @mamun3192 ปีที่แล้ว

    please cover full STL of C++ and policy based Data Structure also ( using STL)

  • @johnmichaelisaac7365
    @johnmichaelisaac7365 ปีที่แล้ว

    I didn't know I could do arrays of pointers for every object I make. This is super helpful thank you so much, learned a lot just from this vid🎉

  • @logingame5877
    @logingame5877 ปีที่แล้ว

    I love ur teaching! When does your Programming course exactly start?