Second, the experimental content: Defines a class named box with three instance variables : Length, Widh , and height, and defines a method for setting the length, width, and height of the box SETLWH () and the method for calculating box area areas () and volume volumn () . Main program code: Using System; Using System.Collections.Generic; Using System.Linq; Using System.Text; Using System.Threading.Tasks; Namespace BOX { Class Box { private double length; Private double Widh; private double height; public void Setlwh (double length,double widh,double height) { this.length = length; This.widh = Widh; This.height = height; } public void Area () { Console.WriteLine (" area is "); Console.WriteLine (2 * (length * widh + widh * height + length * height)); } public void Volumn () { Console.WriteLine (" volume is "); Console.WriteLine (Length * widh * height); } } Class Program { static void Main (string[] args) { Box B = new box (); B.SETLWH (a); B.area (); B.volumn (); Console.ReadLine (); } } } |