Since it is a right octagonal prism then we can get the idea that it's having 90degrees to the vertical but since it is truncated 45degrees from the horizaontal then we can get the idea that the volume of the truncated octagonal prism is half of the volume of the octagonal right prism..
We have the general formula in finding the volume as
where V is the volume, B is the area of the base and H is the altitude or the height
since we know that the volume of the truncated prism is half of the regular one then we'll have the volume as:
The area for a regular octagon is defined by the formula:
where s is the length of one side.
Since you're given that the length of one side is 5cm then you can get the area
substituting it to the formula for volume you'll have:
so that would be the volume in terms of H since you are not given the value of H.