title
C++ Tutorial 10 : Object Oriented Programming

description
Code & Transcript : http://bit.ly/plusplus10 Subscribe to Me: http://bit.ly/2FWQZTx Best C++ Book : https://amzn.to/2JNlnk5 I'm finally covering Object Oriented Programming with C++! I cover classes, objects, public, private, protected, constructors, deconstructors, pointer operator, dot operator, getters, setters, super classes, inheritance, calling super class functions, overwriting functions, and much more. In the problem with this tutorial we will try to model a battle between the Hulk and Thor to the death. MY UDEMY COURSES ARE 87.5% OFF TIL January 31st ($9.99) ➡️ Python Data Science Series for $9.99 : Highest Rated & Largest Python Udemy Course + 56 Hrs + 200 Videos + Data Science https://bit.ly/Master_Python_45 ➡️ C++ Programming Bootcamp Series for $9.99 : Over 23 Hrs + 53 Videos + Quizzes + Graded Assignments + New Videos Every Month https://bit.ly/C_Course_45 ➡️ FREE 15 hour Golang Course!!! : https://bit.ly/go-tutorial6 (100 Available) Like the channel? Consider becoming a Patreon! Check it out here: ►► https://www.patreon.com/derekbanas *Watch More Learn in One Videos* ►► Java - https://youtu.be/n-xAqcBCws4 ►► C++ - https://youtu.be/Rub-JsjMhWY ►► Python - https://youtu.be/N4mEzFDjqtA ►► MySQL - https://youtu.be/yPu6qV5byu4 ►► PHP - https://youtu.be/7TF00hJI78Y ►► Kotlin - https://youtu.be/H_oGi8uuDpA ►► C# - https://youtu.be/lisiwUZJXqQ ►► JavaScript - https://youtu.be/fju9ii8YsGs

detail
{'title': 'C++ Tutorial 10 : Object Oriented Programming', 'heatmap': [{'end': 155.569, 'start': 120.091, 'weight': 0.874}, {'end': 245.61, 'start': 212.565, 'weight': 0.711}, {'end': 465.374, 'start': 354.389, 'weight': 0.768}, {'end': 561.897, 'start': 506.957, 'weight': 0.817}, {'end': 1071.911, 'start': 1040.965, 'weight': 0.974}, {'end': 1214.391, 'start': 1183.773, 'weight': 0.848}, {'end': 1872.402, 'start': 1818.37, 'weight': 0.742}, {'end': 1940.66, 'start': 1912.52, 'weight': 0.742}], 'summary': 'This c++ tutorial on object oriented programming covers private/public constructors, inheritance, creating warriors for battle, using constructors, static methods, method overriding, warrior class creation, and battle simulation, with detailed demonstrations and examples.', 'chapters': [{'end': 32.203, 'segs': [{'end': 32.203, 'src': 'embed', 'start': 0.526, 'weight': 0, 'content': [{'end': 4.909, 'text': 'Well, hello internet and welcome to part 10 of my C++ video tutorial series.', 'start': 0.526, 'duration': 4.383}, {'end': 11.434, 'text': "and finally, we're going to cover object oriented programming in this tutorial, as well as private public constructors inheritance,", 'start': 4.909, 'duration': 6.525}, {'end': 16.297, 'text': "and I'm also going to teach you how to create two fighters and have them fight to the death.", 'start': 11.434, 'duration': 4.863}, {'end': 24.681, 'text': 'like always, all the code is in the description underneath this video, as well as a transcript of the things that I say, and I have a lot to do.', 'start': 16.618, 'duration': 8.063}, {'end': 26.121, 'text': "so let's get into it, alright.", 'start': 24.681, 'duration': 1.44}, {'end': 30.423, 'text': 'so here we are and you can see the different libraries I have included now.', 'start': 26.121, 'duration': 4.302}, {'end': 32.203, 'text': "basically, it's very simple.", 'start': 30.423, 'duration': 1.78}], 'summary': 'C++ tutorial covers object-oriented programming, private/public constructors, inheritance, and creating fighters to battle.', 'duration': 31.677, 'max_score': 0.526, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc526.jpg'}], 'start': 0.526, 'title': 'C++ object oriented programming tutorial', 'summary': 'Covers object oriented programming, private/public constructors, inheritance, and creating two fighters for a battle, with code and transcript provided.', 'chapters': [{'end': 32.203, 'start': 0.526, 'title': 'C++ object oriented programming tutorial', 'summary': 'Covers object oriented programming, private/public constructors, inheritance, and creating two fighters for a battle, with code and transcript provided.', 'duration': 31.677, 'highlights': ['The tutorial covers object oriented programming, private/public constructors, and inheritance.', 'Teaches how to create two fighters and have them fight to the death.', 'Code and transcript are available in the description underneath the video.']}], 'duration': 31.677, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc526.jpg', 'highlights': ['Covers object oriented programming, private/public constructors, and inheritance.', 'Teaches how to create two fighters and have them fight to the death.', 'Code and transcript are available in the description underneath the video.']}, {'end': 806.644, 'segs': [{'end': 80.377, 'src': 'embed', 'start': 32.203, 'weight': 0, 'content': [{'end': 43.147, 'text': 'a class is a blueprint that is going, in which you are going to describe whatever type of real-world object you want to create.', 'start': 32.203, 'duration': 10.944}, {'end': 50.411, 'text': 'okay, so a animal, for example, is going to have two things it is going to have attributes.', 'start': 43.547, 'duration': 6.864}, {'end': 57.094, 'text': "it's going to have things like names and heights and weights, and it's also going to have capabilities.", 'start': 50.411, 'duration': 6.683}, {'end': 65.459, 'text': "it's going to have the ability to eat and run and make sounds, and every real-world object has those two things.", 'start': 57.094, 'duration': 8.365}, {'end': 70.622, 'text': 'and with object-oriented programming, we are going to describe those real-world objects.', 'start': 65.459, 'duration': 5.163}, {'end': 75.233, 'text': 'So sometimes you want to keep things private whenever you are.', 'start': 71.05, 'duration': 4.183}, {'end': 76.754, 'text': 'And this is our blueprint right here.', 'start': 75.313, 'duration': 1.441}, {'end': 80.377, 'text': 'Class is a blueprint for creating objects.', 'start': 76.854, 'duration': 3.523}], 'summary': 'A class is a blueprint for creating objects with attributes and capabilities.', 'duration': 48.174, 'max_score': 32.203, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc32203.jpg'}, {'end': 155.569, 'src': 'heatmap', 'start': 120.091, 'weight': 0.874, 'content': [{'end': 123.192, 'text': "i'm going to have a static variable.", 'start': 120.091, 'duration': 3.101}, {'end': 129.894, 'text': 'now a static variable is going to share the same value for all objects of an animal class.', 'start': 123.192, 'duration': 6.702}, {'end': 132.355, 'text': 'every single object is going to have the same value.', 'start': 129.894, 'duration': 2.461}, {'end': 136.097, 'text': 'so if the value changes, it changes for every single animal.', 'start': 132.355, 'duration': 3.742}, {'end': 140.94, 'text': 'it is a shared value between all objects of the animal class.', 'start': 136.557, 'duration': 4.383}, {'end': 150.606, 'text': "So what we're doing here is we are saying that we want to, every single time a new animal object is created, we want to keep a tally.", 'start': 141.36, 'duration': 9.246}, {'end': 155.569, 'text': 'Now, often static variables either, are going to have a utility value,', 'start': 150.786, 'duration': 4.783}], 'summary': 'Static variable shared among all animal objects for tallying purposes.', 'duration': 35.478, 'max_score': 120.091, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc120091.jpg'}, {'end': 161.813, 'src': 'embed', 'start': 132.355, 'weight': 2, 'content': [{'end': 136.097, 'text': 'so if the value changes, it changes for every single animal.', 'start': 132.355, 'duration': 3.742}, {'end': 140.94, 'text': 'it is a shared value between all objects of the animal class.', 'start': 136.557, 'duration': 4.383}, {'end': 150.606, 'text': "So what we're doing here is we are saying that we want to, every single time a new animal object is created, we want to keep a tally.", 'start': 141.36, 'duration': 9.246}, {'end': 155.569, 'text': 'Now, often static variables either, are going to have a utility value,', 'start': 150.786, 'duration': 4.783}, {'end': 161.813, 'text': "which means it's something that the object itself doesn't do as a real world object.", 'start': 155.569, 'duration': 6.244}], 'summary': 'Static variables are shared among all objects of a class, maintaining a tally for every new object created.', 'duration': 29.458, 'max_score': 132.355, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc132355.jpg'}, {'end': 245.61, 'src': 'heatmap', 'start': 179.75, 'weight': 4, 'content': [{'end': 190.522, 'text': 'Now, public fields, on the other hand, or public methods are going to be accessible anywhere that the object itself is accessible.', 'start': 179.75, 'duration': 10.772}, {'end': 196.289, 'text': 'So these are things that are going to be accessible outside of our blueprint or our class.', 'start': 190.702, 'duration': 5.587}, {'end': 205.461, 'text': 'So if we want to be able to get the name we are going to have to have a way for the user to call for it.', 'start': 196.589, 'duration': 8.872}, {'end': 212.305, 'text': 'So we are going to create a function that goes and gets our name and returns it.', 'start': 205.681, 'duration': 6.624}, {'end': 218.629, 'text': 'So this provides the option to get the name but at the same time it protects the data.', 'start': 212.565, 'duration': 6.064}, {'end': 220.19, 'text': 'All right, what else can we do??', 'start': 218.889, 'duration': 1.301}, {'end': 229.978, 'text': "Well, because we don't know what an object's name is, because our class is going to be created before the object itself,", 'start': 220.39, 'duration': 9.588}, {'end': 234.661, 'text': 'we can refer to all objects using the this keyword.', 'start': 229.978, 'duration': 4.683}, {'end': 239.385, 'text': "So what I'm going to do here is I'm going to allow the user to set the name.", 'start': 234.962, 'duration': 4.423}, {'end': 245.61, 'text': 'And I might want to, in the real world, protect the data that is being sent here.', 'start': 240.005, 'duration': 5.605}], 'summary': "Public fields or methods accessible outside class. create function to get name and allow user to set it. use 'this' keyword for all objects.", 'duration': 54.911, 'max_score': 179.75, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc179750.jpg'}, {'end': 465.374, 'src': 'heatmap', 'start': 354.389, 'weight': 0.768, 'content': [{'end': 365.921, 'text': "So let's just copy that and let's change this to weight and change this to weight and weight and weight and weight and weight.", 'start': 354.389, 'duration': 11.532}, {'end': 366.862, 'text': 'So there we go.', 'start': 366.142, 'duration': 0.72}, {'end': 371.848, 'text': 'Now we have capability to get those values as well as to do other things with them.', 'start': 366.902, 'duration': 4.946}, {'end': 381.36, 'text': "Okay, we're also going to declare another function here that is going to allow the user to set all the values or reset them,", 'start': 372.296, 'duration': 9.064}, {'end': 383.581, 'text': 'because our constructor is going to be used.', 'start': 381.36, 'duration': 2.221}, {'end': 388.864, 'text': 'And as someone pointed out, you do not need to provide a name here with your prototypes.', 'start': 383.861, 'duration': 5.003}, {'end': 393.606, 'text': 'I almost always do it mainly just because I think it makes the code more readable.', 'start': 389.204, 'duration': 4.402}, {'end': 400.389, 'text': 'But I just wanted to show you that option because somebody brought it up in the comments on another part of my tutorial.', 'start': 393.866, 'duration': 6.523}, {'end': 402.872, 'text': 'Also, we are going to have a constructor.', 'start': 400.889, 'duration': 1.983}, {'end': 406.356, 'text': 'And a constructor is going to be called each time an object is created.', 'start': 403.092, 'duration': 3.264}, {'end': 408.078, 'text': 'And it is called Animal.', 'start': 406.796, 'duration': 1.282}, {'end': 411.221, 'text': "There's a tip that that is a constructor.", 'start': 408.418, 'duration': 2.803}, {'end': 413.544, 'text': 'It has the same name as the class itself.', 'start': 411.342, 'duration': 2.202}, {'end': 418.33, 'text': "And you're going to receive a string and a double and another double.", 'start': 413.985, 'duration': 4.345}, {'end': 424.954, 'text': 'with your constructor, and once again these are prototypes and the real methods are going to be created after the class.', 'start': 418.63, 'duration': 6.324}, {'end': 426.435, 'text': 'Another thing.', 'start': 425.274, 'duration': 1.161}, {'end': 434.159, 'text': 'I can also create an overloaded constructor to handle those situations in which no information is passed, no attributes are passed,', 'start': 426.435, 'duration': 7.724}, {'end': 436.04, 'text': "and that's all you have to do to have that set.", 'start': 434.159, 'duration': 1.881}, {'end': 439.202, 'text': "You're also going to have a thing called a deconstructor,", 'start': 436.22, 'duration': 2.982}, {'end': 443.745, 'text': 'which is going to be called automatically when an object is deleted or is no longer being used.', 'start': 439.202, 'duration': 4.543}, {'end': 446.907, 'text': 'And to create that, you just go tilde and animal.', 'start': 444.286, 'duration': 2.621}, {'end': 449.608, 'text': "This is kind of pointless because this really doesn't do anything.", 'start': 446.927, 'duration': 2.681}, {'end': 456.111, 'text': "The default in this situation works just as well as basically creating a deconstructor that doesn't do anything.", 'start': 450.428, 'duration': 5.683}, {'end': 465.374, 'text': 'But you could and very often should create custom deconstructors any time in which you would want to release memory or different system resources.', 'start': 456.291, 'duration': 9.083}], 'summary': 'The transcript discusses creating constructors, prototypes, and deconstructors for an animal class.', 'duration': 110.985, 'max_score': 354.389, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc354389.jpg'}, {'end': 418.33, 'src': 'embed', 'start': 393.866, 'weight': 6, 'content': [{'end': 400.389, 'text': 'But I just wanted to show you that option because somebody brought it up in the comments on another part of my tutorial.', 'start': 393.866, 'duration': 6.523}, {'end': 402.872, 'text': 'Also, we are going to have a constructor.', 'start': 400.889, 'duration': 1.983}, {'end': 406.356, 'text': 'And a constructor is going to be called each time an object is created.', 'start': 403.092, 'duration': 3.264}, {'end': 408.078, 'text': 'And it is called Animal.', 'start': 406.796, 'duration': 1.282}, {'end': 411.221, 'text': "There's a tip that that is a constructor.", 'start': 408.418, 'duration': 2.803}, {'end': 413.544, 'text': 'It has the same name as the class itself.', 'start': 411.342, 'duration': 2.202}, {'end': 418.33, 'text': "And you're going to receive a string and a double and another double.", 'start': 413.985, 'duration': 4.345}], 'summary': 'The tutorial covers the usage of a constructor in a class, receiving a string and two doubles.', 'duration': 24.464, 'max_score': 393.866, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc393866.jpg'}, {'end': 561.897, 'src': 'heatmap', 'start': 506.957, 'weight': 0.817, 'content': [{'end': 511.782, 'text': 'And this is going to be a method that I or function.', 'start': 506.957, 'duration': 4.825}, {'end': 513.684, 'text': 'When I say method and function, same thing.', 'start': 511.802, 'duration': 1.882}, {'end': 515.328, 'text': 'Field variable, same thing.', 'start': 514.028, 'duration': 1.3}, {'end': 519.63, 'text': "All right, I'm creating a function here or a method here called toString.", 'start': 515.529, 'duration': 4.101}, {'end': 525.693, 'text': "And I'm specifically creating it so that I can overwrite it, which means that I'm going to override it later on.", 'start': 519.789, 'duration': 5.904}, {'end': 539.778, 'text': "So I am going to come in here and go animal and number of animals and you're going to be able to refer to your class fields and methods by going in here with these two colons.", 'start': 525.993, 'duration': 13.785}, {'end': 546.1, 'text': "you have right here and I'm gonna set this to zero and that is a static field that we have inside of there.", 'start': 539.778, 'duration': 6.322}, {'end': 555.071, 'text': "I'm also going to define our method for set all and this is just going to be void and animal,", 'start': 546.1, 'duration': 8.971}, {'end': 561.897, 'text': "and again you're going to use your colons inside of here and set all and then I'm going to define what is going to go inside of here.", 'start': 555.071, 'duration': 6.826}], 'summary': 'Creating a method called tostring and a static field, with reference to class fields and methods using colons.', 'duration': 54.94, 'max_score': 506.957, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc506957.jpg'}, {'end': 592.501, 'src': 'embed', 'start': 565.1, 'weight': 7, 'content': [{'end': 571.044, 'text': "or then the variable is going to be called name and then I'm also going to get height, And then let's go down to the next one.", 'start': 565.1, 'duration': 5.944}, {'end': 572.505, 'text': "And we're going to go double.", 'start': 571.244, 'duration': 1.261}, {'end': 574.887, 'text': "And we're going to get weight.", 'start': 573.186, 'duration': 1.701}, {'end': 577.769, 'text': 'And then I can come in and set all these values.', 'start': 575.248, 'duration': 2.521}, {'end': 580.291, 'text': "Once again, we're going to use that pointer operator.", 'start': 577.87, 'duration': 2.421}, {'end': 584.315, 'text': "So we're going to go this name is going to be equal to name.", 'start': 580.311, 'duration': 4.004}, {'end': 592.501, 'text': "And this weight is, well, let's go, whoops, like this is going to be equal to weight.", 'start': 584.835, 'duration': 7.666}], 'summary': 'Defining variables name, height, and weight using pointers.', 'duration': 27.401, 'max_score': 565.1, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc565100.jpg'}], 'start': 32.203, 'title': 'Object-oriented programming basics', 'summary': 'Explains the basics of object-oriented programming, including public fields and methods, the this keyword, constructors, deconstructors, static methods, and method overriding, with demonstrations on setting and getting values for object fields.', 'chapters': [{'end': 179.61, 'start': 32.203, 'title': 'Introduction to object-oriented programming', 'summary': 'Explains the concept of classes as blueprints for creating real-world objects, the attributes and capabilities of objects, and the use of static variables in object-oriented programming.', 'duration': 147.407, 'highlights': ['Classes serve as blueprints for creating real-world objects with attributes and capabilities. Describes the fundamental concept of classes as blueprints for real-world objects with attributes and capabilities.', 'Attributes of real-world objects are represented as variables within a class, such as name, height, and weight for an animal. Explains the concept of attributes and provides examples of attributes for an animal object.', 'Static variables are shared values among all objects of a class and can be used for keeping track of utility values. Highlights the usage and purpose of static variables in keeping shared values and utility values among objects in a class.']}, {'end': 806.644, 'start': 179.75, 'title': 'Object-oriented programming basics', 'summary': "Explains the basics of object-oriented programming, including the use of public fields and methods, the this keyword, creating constructors, deconstructors, and static methods, and overriding methods. it also demonstrates how to set and get values for an object's fields.", 'duration': 626.894, 'highlights': ['The chapter explains the basics of object-oriented programming The transcript provides an overview of object-oriented programming, including the use of public fields and methods, creating constructors, deconstructors, and static methods, and overriding methods.', "The use of public fields and methods It explains that public fields and methods are accessible anywhere that the object itself is accessible, providing a way for the user to get and set the object's name, height, and weight.", "The use of the this keyword The transcript mentions the use of the this keyword to refer to all objects, allowing the user to set the name and access the object's fields and methods.", "Creating constructors, deconstructors, and static methods It illustrates the creation of constructors, deconstructors, and static methods, including an explanation of the constructor's role in creating objects and the deconstructor's role when an object is deleted or no longer in use.", "Setting and getting values for an object's fields The transcript provides detailed steps for setting and getting values for an object's fields, such as name, height, and weight, using methods like set name, set height, and set all."]}], 'duration': 774.441, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc32203.jpg', 'highlights': ['Describes the fundamental concept of classes as blueprints for real-world objects with attributes and capabilities.', 'Explains the concept of attributes and provides examples of attributes for an animal object.', 'Highlights the usage and purpose of static variables in keeping shared values and utility values among objects in a class.', 'The transcript provides an overview of object-oriented programming, including the use of public fields and methods, creating constructors, deconstructors, and static methods, and overriding methods.', "It explains that public fields and methods are accessible anywhere that the object itself is accessible, providing a way for the user to get and set the object's name, height, and weight.", "The transcript mentions the use of the this keyword to refer to all objects, allowing the user to set the name and access the object's fields and methods.", "It illustrates the creation of constructors, deconstructors, and static methods, including an explanation of the constructor's role in creating objects and the deconstructor's role when an object is deleted or no longer in use.", "The transcript provides detailed steps for setting and getting values for an object's fields, such as name, height, and weight, using methods like set name, set height, and set all."]}, {'end': 1317.207, 'segs': [{'end': 879.502, 'src': 'embed', 'start': 847.614, 'weight': 2, 'content': [{'end': 851.335, 'text': "And height, you can see we're using the dot operator and not that pointer operator.", 'start': 847.614, 'duration': 3.721}, {'end': 856.276, 'text': "And let's say he has a height of 33 centimeters.", 'start': 851.355, 'duration': 4.921}, {'end': 863.957, 'text': 'And Fred has a weight that is going to be equal to 10 kilograms.', 'start': 856.916, 'duration': 7.041}, {'end': 867.477, 'text': 'And Fred obviously has a name.', 'start': 864.677, 'duration': 2.8}, {'end': 870.198, 'text': 'And wild guess what that name is.', 'start': 867.777, 'duration': 2.421}, {'end': 870.998, 'text': "It's Fred.", 'start': 870.318, 'duration': 0.68}, {'end': 875.999, 'text': "And let's go and output the information again just to show.", 'start': 871.018, 'duration': 4.981}, {'end': 879.502, 'text': 'that yes, indeed, we went and changed those values.', 'start': 876.539, 'duration': 2.963}], 'summary': "Fred's height is 33cm and weight is 10kg.", 'duration': 31.888, 'max_score': 847.614, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc847614.jpg'}, {'end': 974.733, 'src': 'embed', 'start': 926.245, 'weight': 1, 'content': [{'end': 931.887, 'text': "Now what I'm going to do is I'm going to create a new class and it is going to be called Dog,", 'start': 926.245, 'duration': 5.642}, {'end': 939.089, 'text': 'and Dog is going to inherit everything that is in Animal in the Dog class.', 'start': 931.887, 'duration': 7.202}, {'end': 944.411, 'text': "So it's going to get all of the fields as well as all the methods that are defined in Animal.", 'start': 939.549, 'duration': 4.862}, {'end': 947.234, 'text': 'Now we can of course go and create new ones.', 'start': 944.831, 'duration': 2.403}, {'end': 951.699, 'text': "So we're going to create a string for example that's going to be a sound.", 'start': 947.735, 'duration': 3.964}, {'end': 956.084, 'text': 'And we can come in here and give it a default value of wolf.', 'start': 952, 'duration': 4.084}, {'end': 961.35, 'text': "We're also going to be able to have our public fields and methods as well.", 'start': 956.344, 'duration': 5.006}, {'end': 965.495, 'text': "And so let's go and create something called make.", 'start': 961.911, 'duration': 3.584}, {'end': 968.291, 'text': 'sound and put that inside of there.', 'start': 966.11, 'duration': 2.181}, {'end': 974.733, 'text': "And you're gonna be able to get access to the name for your animal just by referring to it.", 'start': 968.511, 'duration': 6.222}], 'summary': 'Creating a new class dog inheriting from animal with additional fields and methods.', 'duration': 48.488, 'max_score': 926.245, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc926245.jpg'}, {'end': 1071.911, 'src': 'heatmap', 'start': 1027.578, 'weight': 0, 'content': [{'end': 1034.242, 'text': "And then we're going to get an additional thing, which is going to be the sound that our animal or our dog is going to make.", 'start': 1027.578, 'duration': 6.664}, {'end': 1040.945, 'text': "We can also create a default constructor and let's also have our default constructor.", 'start': 1034.442, 'duration': 6.503}, {'end': 1052.806, 'text': "Whenever it is created, let's go and call the animal default constructor and have it go and initialize everything that was done in the animal.", 'start': 1040.965, 'duration': 11.841}, {'end': 1054.926, 'text': "So that's this guy right here.", 'start': 1053.226, 'duration': 1.7}, {'end': 1063.289, 'text': "It's going to call this function and automatically, even if our dog default constructor is called, all of this stuff is going to be done.", 'start': 1055.166, 'duration': 8.123}, {'end': 1066.209, 'text': 'And it is very easy to do that.', 'start': 1064.289, 'duration': 1.92}, {'end': 1071.911, 'text': 'All you need to do is to come in and just go and put the colon here, one colon, followed by animal.', 'start': 1066.349, 'duration': 5.562}], 'summary': 'Creating a default constructor to initialize animal properties automatically.', 'duration': 27.348, 'max_score': 1027.578, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1027578.jpg'}, {'end': 1214.391, 'src': 'heatmap', 'start': 1183.773, 'weight': 0.848, 'content': [{'end': 1191.5, 'text': "So we're going to go and get the name or actually you know what I'm going I'm not going to be able to access that.", 'start': 1183.773, 'duration': 7.727}, {'end': 1197.224, 'text': 'So the reason why is because name is private height is private and weight is private.', 'start': 1191.66, 'duration': 5.564}, {'end': 1202.417, 'text': 'Now, if this was set as protected, I would be able to get that.', 'start': 1197.651, 'duration': 4.766}, {'end': 1203.858, 'text': "So let's just save that.", 'start': 1202.937, 'duration': 0.921}, {'end': 1209.345, 'text': "And remember whenever it was giving me all these errors down here, inside of here? Well, now it's not.", 'start': 1204.139, 'duration': 5.206}, {'end': 1214.391, 'text': "And the reason why is anything that inherits, I'm going to keep this as private though.", 'start': 1209.625, 'duration': 4.766}], 'summary': 'Inheritance of private attributes prevents access; setting as protected allows access', 'duration': 30.618, 'max_score': 1183.773, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1183773.jpg'}], 'start': 807.02, 'title': 'Using constructors and inheritance', 'summary': 'Introduces creating an object using constructors, initializing default values, and modifying values using setter methods. it also explains inheritance in c++, including creating classes, constructors, and methods, with an example of a dog class inheriting from an animal class and overriding methods.', 'chapters': [{'end': 897.993, 'start': 807.02, 'title': 'Using constructors in object creation', 'summary': 'Introduces the process of creating an object using constructors, initializing default values, and then modifying the values using setter methods. it also demonstrates the utilization of a constructor to set initial values for an object.', 'duration': 90.973, 'highlights': ['The chapter introduces the process of creating an object using constructors, initializing default values, and then modifying the values using setter methods.', 'It demonstrates the utilization of a constructor to set initial values for an object.', 'The demonstration includes setting values for an object named Fred, such as height, weight, and name, and then outputting the modified information.', 'The use of the dot operator for setting values is emphasized, as opposed to the pointer operator.', 'It showcases the creation and destruction of an object using a deconstructor.']}, {'end': 1317.207, 'start': 898.193, 'title': 'Inheritance in c++', 'summary': 'Explains the concept of inheritance in c++, including creating classes, constructors, and methods, with an example of a dog class inheriting from an animal class and overriding methods. it also covers accessing private members of the base class and testing the implementation in the main function.', 'duration': 419.014, 'highlights': ['The chapter explains the concept of inheritance in C++, including creating classes, constructors, and methods, with an example of a Dog class inheriting from an Animal class and overriding methods.', 'The example includes creating a string for the sound with a default value of wolf and public fields and methods for the Dog class.', 'It covers the implementation of constructors for the Dog class, including a default constructor and a specific constructor with an additional parameter for the sound.', 'The chapter also discusses overriding the toString method for the Dog class and accessing private members of the base class by using public getter methods.', 'The implementation of the Dog class is tested in the main function by creating a Dog object, setting its attributes, and calling the toString method to display the information.']}], 'duration': 510.187, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc807020.jpg', 'highlights': ['The chapter introduces the process of creating an object using constructors, initializing default values, and then modifying the values using setter methods.', 'The chapter explains the concept of inheritance in C++, including creating classes, constructors, and methods, with an example of a Dog class inheriting from an Animal class and overriding methods.', 'The demonstration includes setting values for an object named Fred, such as height, weight, and name, and then outputting the modified information.', 'The example includes creating a string for the sound with a default value of wolf and public fields and methods for the Dog class.', 'The use of the dot operator for setting values is emphasized, as opposed to the pointer operator.', 'The chapter also discusses overriding the toString method for the Dog class and accessing private members of the base class by using public getter methods.']}, {'end': 1670.969, 'segs': [{'end': 1341.388, 'src': 'embed', 'start': 1317.207, 'weight': 2, 'content': [{'end': 1324.515, 'text': 'and here you can see, spot is 38 centimeters tall, 16 kilograms in weight, and then you can see that spot was destroyed.', 'start': 1317.207, 'duration': 7.308}, {'end': 1329.18, 'text': "and if we whoops, let's move this over here a little bit and you can see and says wolf.", 'start': 1324.515, 'duration': 4.665}, {'end': 1333.486, 'text': 'and then you can see that spot was destroyed, tom was destroyed and fred was destroyed.', 'start': 1329.18, 'duration': 4.306}, {'end': 1334.567, 'text': 'all right, so cool stuff.', 'start': 1333.486, 'duration': 1.081}, {'end': 1341.388, 'text': 'Last thing we want to do here, before we move on to our extremely complicated problem, is I want to call my static method that is,', 'start': 1334.807, 'duration': 6.581}], 'summary': 'Spot is 38cm tall, 16kg, and destroyed. tom and fred were also destroyed.', 'duration': 24.181, 'max_score': 1317.207, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1317207.jpg'}, {'end': 1380.405, 'src': 'embed', 'start': 1353.77, 'weight': 0, 'content': [{'end': 1362.872, 'text': 'And then to access the number of animals, you just go animal and get nom of animals and throw that in there.', 'start': 1353.77, 'duration': 9.102}, {'end': 1363.892, 'text': 'And there we go.', 'start': 1363.232, 'duration': 0.66}, {'end': 1368.455, 'text': 'and run it and look at that number of animals is equal to three,', 'start': 1364.452, 'duration': 4.003}, {'end': 1376.241, 'text': 'and the three includes not only dog spot you know the dog object named spot but also the two objects that were created,', 'start': 1368.455, 'duration': 7.786}, {'end': 1380.405, 'text': 'and the reason why is because we were calling the constructor for animal.', 'start': 1376.241, 'duration': 4.164}], 'summary': 'The number of animals is three, including the dog object named spot and two other objects, as a result of calling the animal constructor.', 'duration': 26.635, 'max_score': 1353.77, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1353770.jpg'}, {'end': 1475.991, 'src': 'embed', 'start': 1420.548, 'weight': 1, 'content': [{'end': 1426.901, 'text': "anytime we're doing something like this, in which a bunch of random things are going to be happening.", 'start': 1420.548, 'duration': 6.353}, {'end': 1431.045, 'text': "It's probably going to be a good idea to use random number generators.", 'start': 1427.121, 'duration': 3.924}, {'end': 1433.808, 'text': 'And here I want to seed my random number generator.', 'start': 1431.225, 'duration': 2.583}, {'end': 1437.269, 'text': "Then what we're going to do is we're going to have a warrior object.", 'start': 1434.187, 'duration': 3.082}, {'end': 1440.87, 'text': "And it's going to be something like Thor.", 'start': 1437.829, 'duration': 3.041}, {'end': 1446.013, 'text': 'And Thor is going to be receiving the name Thor.', 'start': 1441.771, 'duration': 4.242}, {'end': 1448.474, 'text': "He's going to receive a health amount.", 'start': 1446.233, 'duration': 2.241}, {'end': 1451.056, 'text': 'He is going to receive an attack amount.', 'start': 1448.694, 'duration': 2.362}, {'end': 1453.737, 'text': 'And he is going to receive a block amount.', 'start': 1451.296, 'duration': 2.441}, {'end': 1458.559, 'text': "And then we're going to do the same thing for our Hulk.", 'start': 1454.017, 'duration': 4.542}, {'end': 1459.74, 'text': 'So Hulk.', 'start': 1458.759, 'duration': 0.981}, {'end': 1460.6, 'text': 'There we are.', 'start': 1459.94, 'duration': 0.66}, {'end': 1462.121, 'text': 'Throw Hulk inside of there.', 'start': 1460.78, 'duration': 1.341}, {'end': 1463.682, 'text': 'And Hulk.', 'start': 1462.701, 'duration': 0.981}, {'end': 1475.06, 'text': "And then let's say Hulk has more health, but maybe Hulk doesn't have as much power as Thor and maybe not as great of an ability to block.", 'start': 1464.847, 'duration': 10.213}, {'end': 1475.991, 'text': 'All right.', 'start': 1475.41, 'duration': 0.581}], 'summary': 'Using random number generators, creating warrior objects like thor and hulk with specific attributes.', 'duration': 55.443, 'max_score': 1420.548, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1420548.jpg'}, {'end': 1632.658, 'src': 'embed', 'start': 1595.128, 'weight': 4, 'content': [{'end': 1596.79, 'text': 'And this is going to be start fight.', 'start': 1595.128, 'duration': 1.662}, {'end': 1601.954, 'text': "And it's going to receive both of the warriors in some special way.", 'start': 1597.09, 'duration': 4.864}, {'end': 1604.957, 'text': 'And it is then going to compare.', 'start': 1602.475, 'duration': 2.482}, {'end': 1610.211, 'text': 'attack values to block values and it is going to spit out a result.', 'start': 1605.43, 'duration': 4.781}, {'end': 1623.255, 'text': "and also it's going to provide a way to end our attack and say that the battle is over and one of the warriors won and the other one didn't win or died.", 'start': 1610.211, 'duration': 13.044}, {'end': 1632.658, 'text': 'And then on top of that you might want to go and create another function and it also should be static.', 'start': 1623.275, 'duration': 9.383}], 'summary': 'A program will compare attack and block values of warriors and determine the battle outcome.', 'duration': 37.53, 'max_score': 1595.128, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1595128.jpg'}], 'start': 1317.207, 'title': 'Creating warriors and static method', 'summary': 'Introduces a static method to determine the number of different animal objects created, revealing three animal objects were created; it also covers creating two warriors named thor and hulk, allowing user input for their information, using random number generators for battle, and creating classes for warrior and battle with specific functions for attack, block, and start fight.', 'chapters': [{'end': 1380.405, 'start': 1317.207, 'title': 'Static method on animal objects', 'summary': 'Introduces a static method to determine the number of different animal objects created, revealing that three animal objects were ultimately created, including a dog named spot and two other objects.', 'duration': 63.198, 'highlights': ['The number of animal objects created is determined to be three, including the dog named spot and two other objects, by using a static method. (Quantifiable data: 3 animal objects created)', "Spot, the dog, is 38 centimeters tall and weighs 16 kilograms. (Quantifiable data: Spot's dimensions: 38 cm tall, 16 kg weight)", 'The chapter ends with the introduction of a static method to determine the number of different animal objects created. (Relevance: Introducing a new concept)']}, {'end': 1670.969, 'start': 1380.405, 'title': 'Creating two warriors battle', 'summary': 'Covers the process of creating two warriors named thor and hulk, allowing user input for their information, using random number generators for battle, and creating classes for warrior and battle with specific functions for attack, block, and start fight.', 'duration': 290.564, 'highlights': ['Creating warrior classes for Thor and Hulk with health, attack, and block attributes The process involves creating warrior classes for Thor and Hulk, each receiving health, attack, and block attributes.', 'Using random number generators for battle The chapter recommends using random number generators for a battle scenario.', 'Defining a battle class with a start fight function A battle class is defined with a start fight function to compare attack and block values and determine a battle result.', 'Suggesting the creation of a get attack result function The chapter suggests creating a get attack result function to calculate damage and decide the battle outcome.', 'Providing hints for creating public functions for attack and block in the warrior class Hints are provided for creating public functions for attack and block within the warrior class.']}], 'duration': 353.762, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1317207.jpg', 'highlights': ['The number of animal objects created is determined to be three, including the dog named spot and two other objects, by using a static method. (Quantifiable data: 3 animal objects created)', 'Creating warrior classes for Thor and Hulk with health, attack, and block attributes The process involves creating warrior classes for Thor and Hulk, each receiving health, attack, and block attributes.', "Spot, the dog, is 38 centimeters tall and weighs 16 kilograms. (Quantifiable data: Spot's dimensions: 38 cm tall, 16 kg weight)", 'Using random number generators for battle The chapter recommends using random number generators for a battle scenario.', 'Defining a battle class with a start fight function A battle class is defined with a start fight function to compare attack and block values and determine a battle result.']}, {'end': 1943.162, 'segs': [{'end': 1740.632, 'src': 'embed', 'start': 1671.75, 'weight': 0, 'content': [{'end': 1676.011, 'text': 'Public, what is going to be some attributes our warrior will have once.', 'start': 1671.75, 'duration': 4.261}, {'end': 1679.152, 'text': "Yeah, you know what? Let's keep everything private and protected.", 'start': 1676.191, 'duration': 2.961}, {'end': 1681.872, 'text': "So I'm gonna say private,", 'start': 1679.352, 'duration': 2.52}, {'end': 1694.875, 'text': "and the two attributes a warrior is gonna have is it's going to have an attack maximum and it's also going to have a block Maximum,", 'start': 1681.872, 'duration': 13.003}, {'end': 1697.655, 'text': "and that's gonna go along with these two guys right here.", 'start': 1694.875, 'duration': 2.78}, {'end': 1700.036, 'text': "And I think that's all that I need for that.", 'start': 1697.996, 'duration': 2.04}, {'end': 1701.387, 'text': 'So What else are we going to need??', 'start': 1700.056, 'duration': 1.331}, {'end': 1706.69, 'text': "Well, obviously I'm going to keep this public, because I don't think this is information that needs to be protected.", 'start': 1701.407, 'duration': 5.283}, {'end': 1710.853, 'text': "I'm going to have the name be defined inside of here.", 'start': 1707.11, 'duration': 3.743}, {'end': 1713.995, 'text': "And also, we're going to need access to change the health.", 'start': 1711.093, 'duration': 2.902}, {'end': 1718.217, 'text': 'So to keep things kind of easy, I could do the setters and the getters and so forth.', 'start': 1714.195, 'duration': 4.022}, {'end': 1720.779, 'text': "But I'm just going to go in here and put health inside of there.", 'start': 1718.237, 'duration': 2.542}, {'end': 1730.766, 'text': "Now, what else do we need? Well, we're going to need a constructor for a warrior and that is going to be structured like warrior.", 'start': 1721.079, 'duration': 9.687}, {'end': 1736.169, 'text': "And we're going to go and we're going to define it directly inside of here just to show you that that can be done as well.", 'start': 1731.086, 'duration': 5.083}, {'end': 1738.03, 'text': "So it's going to receive a name.", 'start': 1736.489, 'duration': 1.541}, {'end': 1740.632, 'text': "It's going to receive a health amount.", 'start': 1738.211, 'duration': 2.421}], 'summary': 'Creating a warrior class with private attributes for attack and block maximum, along with public attributes for name and health, as well as a constructor for the warrior.', 'duration': 68.882, 'max_score': 1671.75, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1671750.jpg'}, {'end': 1814.907, 'src': 'embed', 'start': 1767.289, 'weight': 3, 'content': [{'end': 1774.874, 'text': "so go, health and health, and we'll also do the attack maximum.", 'start': 1767.289, 'duration': 7.585}, {'end': 1780.362, 'text': 'Just go and copy that and attack maximum and attack maximum.', 'start': 1775.339, 'duration': 5.023}, {'end': 1781.823, 'text': 'The names are the same, right? Yes.', 'start': 1780.482, 'duration': 1.341}, {'end': 1784.305, 'text': 'And block max as well.', 'start': 1782.504, 'duration': 1.801}, {'end': 1791.689, 'text': 'So there is our constructor that is going to receive those values and assign them to each of our warrior objects.', 'start': 1784.725, 'duration': 6.964}, {'end': 1797.193, 'text': "Okay So what are we going to do down inside of attack? Well, we're just going to do something very simple.", 'start': 1792.11, 'duration': 5.083}, {'end': 1800.355, 'text': "We're just going to go return and we're going to get a random value.", 'start': 1797.233, 'duration': 3.122}, {'end': 1810.455, 'text': 'And we are going to do modulus and this to get our attack amount that our different warriors are going to do.', 'start': 1801.088, 'duration': 9.367}, {'end': 1811.884, 'text': 'Okay Pretty simple.', 'start': 1810.755, 'duration': 1.129}, {'end': 1814.106, 'text': 'I mean, one line of code in a function.', 'start': 1812.124, 'duration': 1.982}, {'end': 1814.907, 'text': 'Pretty easy.', 'start': 1814.186, 'duration': 0.721}], 'summary': 'Code snippet discussing assigning values to warrior objects and creating a simple attack function.', 'duration': 47.618, 'max_score': 1767.289, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1767289.jpg'}, {'end': 1897.572, 'src': 'heatmap', 'start': 1818.37, 'weight': 4, 'content': [{'end': 1821.633, 'text': 'And that is going to go and allow us to block attacks.', 'start': 1818.37, 'duration': 3.263}, {'end': 1822.894, 'text': "And guess what? That's it.", 'start': 1821.793, 'duration': 1.101}, {'end': 1825.637, 'text': 'There is your entire warrior class.', 'start': 1823.054, 'duration': 2.583}, {'end': 1826.498, 'text': 'Pretty simple.', 'start': 1825.757, 'duration': 0.741}, {'end': 1832.163, 'text': 'And this is a pretty good example of the type of classes you should try to make.', 'start': 1826.698, 'duration': 5.465}, {'end': 1832.804, 'text': 'So there you go.', 'start': 1832.323, 'duration': 0.481}, {'end': 1833.905, 'text': 'We went and created that.', 'start': 1832.824, 'duration': 1.081}, {'end': 1836.643, 'text': 'Now we get down into our battle class.', 'start': 1834.181, 'duration': 2.462}, {'end': 1837.844, 'text': 'What are we going to do here?', 'start': 1836.903, 'duration': 0.941}, {'end': 1846.19, 'text': "Basically, we're going to pass warriors into our function, start fight right here and we're going to pass them by reference.", 'start': 1838.264, 'duration': 7.926}, {'end': 1852.976, 'text': "Why are we doing that? We're passing them by reference so that we will be able to change the values and the values will stay the same.", 'start': 1846.291, 'duration': 6.685}, {'end': 1856.799, 'text': "So how do we pass by reference? I've covered this in the past, of course.", 'start': 1853.156, 'duration': 3.643}, {'end': 1860.74, 'text': "And if you're getting any of this wrong or anything, don't worry about it.", 'start': 1857.119, 'duration': 3.621}, {'end': 1863.14, 'text': "It's a very complicated problem.", 'start': 1861.12, 'duration': 2.02}, {'end': 1864.38, 'text': 'This is a challenging one.', 'start': 1863.18, 'duration': 1.2}, {'end': 1868.341, 'text': 'So every once in a while we need to challenge ourselves to think in new ways.', 'start': 1864.961, 'duration': 3.38}, {'end': 1872.402, 'text': "And I'm going to say Warrior 2.", 'start': 1869.462, 'duration': 2.94}, {'end': 1876.683, 'text': "And I'm very, very doubtful that you're solving this exactly the same way that I'm solving it.", 'start': 1872.402, 'duration': 4.281}, {'end': 1878.863, 'text': "Because, you know, I don't know.", 'start': 1876.903, 'duration': 1.96}, {'end': 1881.544, 'text': 'You might be newer at this or whatever.', 'start': 1879.124, 'duration': 2.42}, {'end': 1884.105, 'text': "So then what I'm going to do, I'm going to use a technique that I used before.", 'start': 1881.664, 'duration': 2.441}, {'end': 1890.929, 'text': 'And this is going to continue to loop forever until one of our warriors health goes below zero.', 'start': 1884.125, 'duration': 6.804}, {'end': 1892.389, 'text': "So I'm going to use the while true.", 'start': 1890.989, 'duration': 1.4}, {'end': 1897.572, 'text': "And then inside of here, I'm going to create the situation in which we are going to end it.", 'start': 1892.67, 'duration': 4.902}], 'summary': 'Creating a warrior class for blocking attacks and passing warriors by reference in a battle class.', 'duration': 40.453, 'max_score': 1818.37, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1818370.jpg'}, {'end': 1940.66, 'src': 'heatmap', 'start': 1912.52, 'weight': 0.742, 'content': [{'end': 1919.969, 'text': "so I'm gonna go compare to and what I'm gonna do here, just because I think this makes the code easy to understand.", 'start': 1912.52, 'duration': 7.449}, {'end': 1924.314, 'text': "I'm actually gonna have the function get attack, result, pass back a string.", 'start': 1919.969, 'duration': 4.345}, {'end': 1931.533, 'text': "that's going to say game over, and if game over is indeed Pass back, it will signal that the game is indeed over.", 'start': 1924.314, 'duration': 7.219}, {'end': 1933.135, 'text': "And here I'm using compare.", 'start': 1931.934, 'duration': 1.201}, {'end': 1939.299, 'text': 'Anytime you compare two things and they are equal, compare, the compare function is going to return the value of zero.', 'start': 1933.355, 'duration': 5.944}, {'end': 1940.66, 'text': "And that's what I did right there.", 'start': 1939.539, 'duration': 1.121}], 'summary': "Function 'getattackresult' returns 'game over' string if game is over, using compare to check for equality.", 'duration': 28.14, 'max_score': 1912.52, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1912520.jpg'}], 'start': 1671.75, 'title': 'Warrior class creation and battle algorithm', 'summary': 'Covers the creation of a private warrior class with attributes for attack maximum, block maximum, and health, as well as the implementation of a constructor. it also explains the creation of a simple warrior class, a battle class, and the process of simulating a battle between two warriors using a while loop and comparison function.', 'chapters': [{'end': 1740.632, 'start': 1671.75, 'title': 'Creating warrior class and attributes', 'summary': 'Covers the creation of a private warrior class with attributes for attack maximum, block maximum, name, and health, along with the implementation of a constructor.', 'duration': 68.882, 'highlights': ['The warrior class will have private attributes for attack maximum and block maximum, which are essential for defining the capabilities of the warrior.', 'The implementation of a constructor for the warrior class, which will receive and define the name and health amount, is a crucial part of the process.', 'The need for setters and getters to manage access to the health attribute is highlighted, ensuring flexibility and ease of use for future modifications.']}, {'end': 1856.799, 'start': 1740.912, 'title': 'Simple warrior class and battle class', 'summary': 'Explains the creation of a simple warrior class and a battle class, including the process of assigning values to warrior objects, determining attack and block amounts, and passing warriors by reference in the battle class.', 'duration': 115.887, 'highlights': ['The process of assigning values to warrior objects involves setting the name, health, attack maximum, and block maximum for each warrior.', 'The attack function utilizes a simple one-liner of code to generate a random attack amount for different warriors using modulus operation.', 'The creation of a simple warrior class and a battle class is highlighted as a good example of the type of classes to be made.']}, {'end': 1943.162, 'start': 1857.119, 'title': 'Warrior battle algorithm', 'summary': 'Introduces a complex problem of creating a while loop to simulate a battle between two warriors, using the while true loop and implementing a comparison function to determine the end of the battle, emphasizing the importance of challenging oneself to think in new ways.', 'duration': 86.043, 'highlights': ['The chapter introduces a complex problem of creating a while loop to simulate a battle between two warriors, using the while true loop and implementing a comparison function to determine the end of the battle.', 'Emphasizes the importance of challenging oneself to think in new ways while solving complex problems.', "The technique of using a while true loop is employed to ensure the battle continues until one warrior's health goes below zero.", "A comparison function is utilized to signal the end of the battle when a warrior's health goes below zero."]}], 'duration': 271.412, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1671750.jpg', 'highlights': ['The implementation of a constructor for the warrior class is crucial for defining the name and health amount.', "The warrior class will have private attributes for attack maximum and block maximum, defining the warrior's capabilities.", 'The need for setters and getters to manage access to the health attribute ensures flexibility and ease of use for future modifications.', 'The process of assigning values to warrior objects involves setting the name, health, attack maximum, and block maximum for each warrior.', 'The chapter introduces a complex problem of creating a while loop to simulate a battle between two warriors, emphasizing the importance of challenging oneself to think in new ways while solving complex problems.', "The technique of using a while true loop is employed to ensure the battle continues until one warrior's health goes below zero.", "A comparison function is utilized to signal the end of the battle when a warrior's health goes below zero.", 'The attack function utilizes a simple one-liner of code to generate a random attack amount for different warriors using modulus operation.']}, {'end': 2423.165, 'segs': [{'end': 2241.004, 'src': 'embed', 'start': 2210.12, 'weight': 1, 'content': [{'end': 2216.284, 'text': "let's move this up the whole way so you can see everything at once, is down to,", 'start': 2210.12, 'duration': 6.164}, {'end': 2221.928, 'text': "and then i'm going to print out the health amount that the warrior is after the attack,", 'start': 2216.284, 'duration': 5.644}, {'end': 2230.995, 'text': "and i am then going to go and get warrior b's name to right here and paste that inside of there.", 'start': 2221.928, 'duration': 9.067}, {'end': 2236.54, 'text': "And then I'm also going to go and get the Health amount for that Warrior.", 'start': 2231.495, 'duration': 5.045}, {'end': 2241.004, 'text': 'So I have to go Warrior B and Health.', 'start': 2236.78, 'duration': 4.224}], 'summary': 'Code prints the health amount of a warrior after an attack.', 'duration': 30.884, 'max_score': 2210.12, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc2210120.jpg'}, {'end': 2385.782, 'src': 'embed', 'start': 2339.607, 'weight': 0, 'content': [{'end': 2343.329, 'text': 'Okay, C++ requires a type specifier for all declarations.', 'start': 2339.607, 'duration': 3.722}, {'end': 2344.21, 'text': 'This is line 47.', 'start': 2343.429, 'duration': 0.781}, {'end': 2347.592, 'text': "Let's see what I accidentally typed inside of here.", 'start': 2344.21, 'duration': 3.382}, {'end': 2348.532, 'text': 'Oh, I see.', 'start': 2347.612, 'duration': 0.92}, {'end': 2352.475, 'text': 'I forgot to put in that I was going to be returning a string.', 'start': 2348.772, 'duration': 3.703}, {'end': 2353.936, 'text': 'All right, so I got that.', 'start': 2352.495, 'duration': 1.441}, {'end': 2354.436, 'text': "Let's run it.", 'start': 2353.976, 'duration': 0.46}, {'end': 2358.299, 'text': 'Anything else? Yes, line 63 it says right here.', 'start': 2354.696, 'duration': 3.603}, {'end': 2360.4, 'text': 'I accidentally typed in two equal signs.', 'start': 2358.319, 'duration': 2.081}, {'end': 2361.623, 'text': 'Save it and run it.', 'start': 2360.683, 'duration': 0.94}, {'end': 2362.544, 'text': 'And there we go.', 'start': 2361.843, 'duration': 0.701}, {'end': 2365.325, 'text': 'Looks like it worked beautifully.', 'start': 2362.804, 'duration': 2.521}, {'end': 2367.485, 'text': "So we're going to have Thor attacking Hulk.", 'start': 2365.625, 'duration': 1.86}, {'end': 2370.266, 'text': "So we're going to have Thor attacks Hulk and does 5 damage.", 'start': 2367.666, 'duration': 2.6}, {'end': 2372.227, 'text': 'Hulk is down to 130 health.', 'start': 2370.307, 'duration': 1.92}, {'end': 2374.108, 'text': 'What did he start with? 135.', 'start': 2372.247, 'duration': 1.861}, {'end': 2374.548, 'text': 'Looks good.', 'start': 2374.108, 'duration': 0.44}, {'end': 2377.109, 'text': 'Then Hulk attacks Thor to deal 0 damage.', 'start': 2374.768, 'duration': 2.341}, {'end': 2382.111, 'text': 'He must have missed or Thor threw up some sort of storm or something in his way.', 'start': 2377.129, 'duration': 4.982}, {'end': 2385.782, 'text': 'Thor attacks Hulk, does 10 damage, down to 120.', 'start': 2382.331, 'duration': 3.451}], 'summary': 'Debugging c++ code, fixing errors, and testing: line 47, 63. successful execution with thor attacking hulk, dealing 5 and 10 damage, respectively.', 'duration': 46.175, 'max_score': 2339.607, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc2339607.jpg'}], 'start': 1943.422, 'title': 'Warrior battle simulation', 'summary': "Explains a program simulating a battle between two warriors, detailing the logic for the battle, damage calculation, and outcome, with an example of thor and hulk battling until thor's defeat and hulk's victory.", 'chapters': [{'end': 2423.165, 'start': 1943.422, 'title': 'Warrior battle simulation', 'summary': "Explains a program that simulates a battle between two warriors, detailing the logic for the battle, damage calculation, and outcome, with an example of thor and hulk battling until thor's defeat and hulk's victory.", 'duration': 479.743, 'highlights': ["The program simulates a battle between two warriors, with the example of Thor and Hulk, detailing the attack and damage calculations. The chapter explains a program that simulates a battle between two warriors, detailing the logic for the battle, damage calculation, and outcome, with an example of Thor and Hulk battling until Thor's defeat and Hulk's victory.", "The process involves calculating the damage done by each warrior, managing their health, and determining the outcome of the battle. The chapter details the process of calculating the damage done by each warrior, managing their health, and determining the outcome of the battle, with an example of Thor and Hulk battling until Thor's defeat and Hulk's victory.", 'The program encounters errors during execution, which are identified and resolved, demonstrating the debugging process. The chapter demonstrates the identification and resolution of errors encountered during program execution, showcasing the debugging process to ensure the correct functioning of the simulation.']}], 'duration': 479.743, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ZOKLjJF54Xc/pics/ZOKLjJF54Xc1943422.jpg', 'highlights': ['The program simulates a battle between two warriors, with the example of Thor and Hulk, detailing the attack and damage calculations.', 'The process involves calculating the damage done by each warrior, managing their health, and determining the outcome of the battle.', 'The program encounters errors during execution, which are identified and resolved, demonstrating the debugging process.']}], 'highlights': ['Covers object oriented programming, private/public constructors, and inheritance.', 'Describes the fundamental concept of classes as blueprints for real-world objects with attributes and capabilities.', 'The number of animal objects created is determined to be three, including the dog named spot and two other objects, by using a static method. (Quantifiable data: 3 animal objects created)', 'Creating warrior classes for Thor and Hulk with health, attack, and block attributes The process involves creating warrior classes for Thor and Hulk, each receiving health, attack, and block attributes.', "Spot, the dog, is 38 centimeters tall and weighs 16 kilograms. (Quantifiable data: Spot's dimensions: 38 cm tall, 16 kg weight)", 'The implementation of a constructor for the warrior class is crucial for defining the name and health amount.', 'The program simulates a battle between two warriors, with the example of Thor and Hulk, detailing the attack and damage calculations.']}