00:01
In this question, we have to write a code in c++.
00:04
So, let us see how we are going to implement this.
00:08
So, we will be having a beverage class here.
00:18
So, we will be defining a beverage class, which is a base class for all the beverages that we will be including.
00:27
So, it contains member variables to store the common attributes of a beverage that is there.
00:33
That is, the attributes will be name, then the description, then we will be having the serving size, then we will be having calories.
01:14
So, these are the attributes that we will be having.
01:18
So, we will be having the name, description, serving size and calories.
01:25
Then, we will be having the price that is there.
01:32
So, these we will be including in this class that is beverage.
01:38
Then, we will be having a virtual destructor, which will be having all this.
01:46
And in the end, we will be having a main function to implement all this.
01:52
And where the program execution will happen.
01:56
So, let us see how we are going to proceed with this question.
02:01
Let me show you that in a basic c+ + compiler.
02:06
So, first we will be including the necessary header files that are there.
02:10
So, which is include iostream .h and include string .h.
02:17
So, these are used for input, output and string manipulation operations.
02:22
So, now we will be including a beverage class that is there.
02:30
So, as you can see, i'll include a beverage class.
02:36
So, here as we discussed, we have defined a beverage class that is a base class for all the beverages.
02:45
And it contains the variables to store the common attributes of the beverage, that is the name, description, serving size, calories and price.
02:56
So, the class also provides a parameterized constructor.
03:01
So, let us see about that.
03:05
So, here you can see that this is the virtual constructor, parameterized constructor to initialize and these attributes that are there...