ถามเองเขียนเอง ลองทำดูแล้ว มันได้แล้วคับ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
public class TestMethod
{
public double triangle(double Height, double Width)
{
return 0.5*(Height * Width);
}
public double Square(double Height, double Width)
{
return Height * Width;
}
public static void Main()
{
TestMethod tm = new TestMethod();
Console.WriteLine("Triangle 1/2 x height x Width " + tm.triangle(15, 7));
Console.WriteLine("Square height x width " + tm.Square(6, 7));
Console.ReadLine();
}
}
}