00:01
Okay, so we're given this problem where we want to create a couple of classes, one describing pizza with some data for description and price.
00:11
Another subclass of pizza called delivery pizza, which adds the attributes of a delivery fee and an address, and with some different requirements on what the delivery fee would be.
00:23
And then we want to write an application that basically makes two of these objects of each type, makes two objects of each of the types, and displays what the values are.
00:36
So let's go ahead and do that.
00:39
So let's start off with pizza.
00:43
And so we want to create a class pizza with description and price.
00:48
So let's go ahead and initiate these variables, string, description, and then let's do a float for the price.
00:57
And let's make a constructor that takes in the description and the price, where the description is a string and the price is a float.
01:13
And so what we want to do is simply set that this description is equal to the description passed in.
01:20
And the price equal to the price passed in.
01:25
And then since it also says that we would like to have a method to display the data, that's also write a public method.
01:37
In this case, we just want to display data, so we don't have to return anything.
01:41
And let's call it display.
01:44
And here we're just going to go ahead and print out this description and then print out the price.
02:05
And so now we have these two, you have the constructor that will make the pizza class, and then a display method that'll allow us to to print out what the values of the pizza object are.
02:19
And so now we'd like to create our delivery pizza.
02:24
And so we're going to be adding on two things.
02:29
We're going to be adding on a delivery fee and delivery address.
02:33
So let's add the flow of the fee and a string representing the address.
02:39
And then we want to make a constructor, in this case delivery pizza.
02:44
It also takes in a description, a id, so for price.
02:58
And then we want the address, a string.
03:06
And then first we would like to call super to create an object, description, price...