コード例 #1
0
        public SampleStruct sqrLength()
        {
            SampleStruct rct = new SampleStruct();

            Console.Write("length : ");
            rct.Value = rct.Read();
            return(rct);
        }
コード例 #2
0
        public void newSquare()
        {
            SampleStruct rct = new SampleStruct();

            Console.WriteLine("\nInput the dimensions of the Square( equal length and breadth ) : ");
            ln = sqrLength();
            Console.Write("breadth : ");
            ht.Value = rct.Read();
        }
コード例 #3
0
        // The void modifier specifies that this method does not
        // return a value
        public void NewSquare()
        {
            // This code segment calls the default constructor for
            // SampleStruct and instantiates an object to save data
            // from the output
            SampleStruct rct = new SampleStruct();

            Console.WriteLine("\nInput the dimensions of the Square ( equal length and width ) : ");
            length = SqrLength();
            Console.Write("Width : ");
            height.Value = rct.Read();
        }