00:01
Okay, so we're given a long question here, all associated with a class called stock.
00:07
And so what we're going to want to do is create the stock class and associate all these, this data and these methods, and then test it out a little bit.
00:18
So the first thing that it asks us to do is to create a couple of fields such as the symbol, the name, and previous closing price, current price, and so on.
00:35
So let's go ahead and create those.
00:37
So it says that the symbol of a stock is stored in the string.
00:41
So private string, in this case, this wants to be symbol.
00:48
And then we have private string for the name.
00:53
And then we have the previous closing price, which would be a double.
01:00
And then we have the current price, which is also a double.
01:04
So private double current price.
01:09
And these are our four data objects.
01:14
And so now we want to create a constructor.
01:16
So we want to do public stock.
01:20
In this case, we want to give it the following.
01:25
We were given the symbol and name.
01:28
So we have the symbol.
01:30
So string, symbol, string name.
01:36
In this case, we just want to set this.
01:38
This dot symbol is equal to the simple passed in, then this dot name is equal to the name passed in.
01:46
So now we have this constructor.
01:53
And so now what we want to do is we want to make these get and set methods for all of the data.
02:01
So for the previous closing price and the current price, you would like to create these methods.
02:13
So let's see, let's go ahead and add the button methods to get these things.
02:22
So public double get previous closing price.
02:30
You just want to return the previous closing price.
02:37
And then we want to do the same for the current price.
02:43
So double get current price returns the current price.
02:52
And then we want to make some setters.
02:54
So we want to do public void set, previous closing price.
03:00
And then we want to give the double.
03:03
And so we want the previous closing price just to equal to the price.
03:10
And then it's very similar with the current price.
03:15
We want to set current price equal to the price that's passed in.
03:23
Current price just equal to the price...