Volumen de una caja
Crea una función que recibe un objeto Box con las propiedades Width, Length y Height, y devuelve su volumen.
Ejemplos
Program.VolumeOfBox(new Box { Width = 2, Length = 5, Height = 1 }) ➞ 10
Program.VolumeOfBox(new Box { Width = 4, Length = 2, Height = 2 }) ➞ 16Notas
- Las dimensiones son enteros no negativos.
- El volumen es width por length por height.
- El resultado cabe en un
longde C#.