Volume de uma caixa

Published by SyntaxGardener in

Crie uma função que recebe um objeto Box com as propriedades Width, Length e Height e retorna seu volume.

Exemplos

Program.VolumeOfBox(new Box { Width = 2, Length = 5, Height = 1 }) ➞ 10
Program.VolumeOfBox(new Box { Width = 4, Length = 2, Height = 2 }) ➞ 16

Notas

  • As dimensões são números inteiros não negativos.
  • O volume é width vezes length vezes height.
  • O resultado cabe em um long do C#.