00:01
In this question, we have to write a c+ + code for a pop -up food truck business that is there.
00:11
So in this, we have to implement certain functions that are there that will take certain integers according to what is given to us in the question.
00:32
So the question has a lot of series of queries that we have to address one by one.
00:38
So we just look into a c+ + compiler on how this is done and i'll show you the program there.
00:47
So let us consider a basic compiler for example.
00:53
Now we have to include the basic necessary header files first as you can see.
01:01
So here as we can see, he included the files iostream then for ioman, man, iep and string.
01:12
So these use the standard namespace for config.
01:15
So for that we will use this line.
01:20
Now what we have to do is we have to define certain constants as i told you for the rate, tags, maximum number of menu items and maximum number of order items.
01:31
So this is given to us in the question.
01:33
So according to the question, we have to write these constants that are there.
01:38
We have to define these constants according to that.
01:41
So now let these two we define the two structs now for this that is menu item and ordered item.
01:53
So let us see the two structures that we will now introduce.
01:57
So as you can see here, i've written the names for the two structures that is main menu item to represent a menu item with its name description, base price, add -ons and their costs and ordered items is another structure that we are using to represent an ordered item within with its name that is the item name, then the selected add -ons and the total price that is the item price.
02:31
So that is why we are using these two struct functions.
02:34
That will represent these certain strings in that struct function.
02:41
So now we have to give us initialize a function that is initialize that will initialize the menu array.
02:52
So for that we are using this function here.
02:56
So i'll explain to you how this is given.
03:00
So here you can see that the function that initializes the menu array with it hard -coded menu items that are there.
03:09
Each menu item is assigned values for name description base price that is there the add -ons and their costs.
03:20
So you can see this is how the entire function is built over here.
03:27
So this array is built over here giving the each item on the menu into a one particular array.
03:35
So here as it is given in the question in the same way the entire things are assigned that is the name description the base price add -on everything.
03:48
So we have to just write this as per the question that is given to us.
03:52
Then we have to display whatever this is.
03:57
We have to make it display the menu items in a user -friendly format.
04:01
So for that we will use a show menu function.
04:06
So as you can see here this function will display the menu items in a user -friendly format.
04:13
It iterates through using a for loop.
04:17
It iterates through the menu array that is there and prints each item's name base price that is their description and add -ons along with the respective costs as you can see here.
04:29
So this is done also with the help of what is given to us and what we are asked in the question.
04:36
So that is how this function will display all these things that are there in the menu item.
04:43
So now next what we have to do is we have to bring a function that will check if the user's choice is valid within a specified range or not.
04:53
So we have to use a function that will also check if a user's yes or no option is valid or not.
05:01
So for that we will use two functions that are there.
05:07
One is valid choice.
05:09
This will tell us if the user's choice is valid within a specified range or not.
05:16
So for that we are using this value that is given to us over here.
05:21
And next we are doing is we are checking in this function that is valid yes no function.
05:27
We are using to check if the user's yes or no option is valid.
05:34
So for that we are using y, y, n and n.
05:38
So in next what we have to do is we have to prompt the user to enter a choice and validate it using a function.
05:46
So for that we are using get menu choice.
05:52
So i'll just print that over here.
06:01
So in such a way we can get the whatever is in the menu.
06:09
We have we want user to enter their choice...