コード例 #1
0
        static void Main(string[] args)
        {
			DaysTemp temp = new DaysTemp();		// Create the object
			
			temp.High = 85;			// Assign to the fields
			temp.Low = 60;

			Console.WriteLine("High:	{0}", temp.High);	// Read from fields
			Console.WriteLine("Low:		{0}", temp.Low);
		}
コード例 #2
0
ファイル: together.cs プロジェクト: creating2000/Codes
        static void Main(string[] args)
        {
			// Create two instances of DaysTemp
			DaysTemp t1 = new DaysTemp();
			DaysTemp t2 = new DaysTemp();
			
			// Write to the fields of each instance
			t1.High = 76;
			t1.Low = 57;
			
			t2.High = 75;
			t2.Low = 53;
			
			// Read from the fields from each instance
			// Call the method of each instance
			Console.WriteLine("t1:	{0},	{1},	{2}", t1.High, t1.Low, t1.Average());
			Console.WriteLine("t2:	{0},	{1},	{2}", t2.High, t2.Low, t2.Average());
		}
コード例 #3
0
ファイル: private.cs プロジェクト: creating2000/Codes
        static void Main(string[] args)
        {
			DaysTemp dt = new DaysTemp();
			float avg = dt.Average();
			Console.WriteLine(avg);
		}