using System;
// 1. Create an interface IShape
// 1.1 [Code] Declare one property Name (string)
// 1.2 [Code] Declare one function CalculateArea()
// Input: none
// Output: double
// 2. Create an interface IColor
// 2.1 [Code] Declare one property Color (string)
// 2.2 [Code] Declare one function IsYellow()
// Output: bool
//3. Create a class inherit from IShape and IColor
public class Triangle //[Code] 3.1 Inherit from both Ishape and IColor
{
// [Code] 3.2 Create a private field and a public property for Name variable.
// The length of name should be more than 0. If length is zero,
// issue a warning and to not change the current value.
// (Hint: use Length property of a string.)
// [Code] 3.3 Create a protected property for Color variable.
// Access modifier is "protected"
//
// Hint: protected vs private
// A protected member is accessible within its class and by derived class instances.
// Private members are accessible only within the body of the class or
// the struct in which they are declared/
// [Code] 3.4 Create two properties: Base (double) and Height (double)
// Use auto-implementation
// Default constructor
public Triangle() { }
// [Code] 3.4 Declare the second constructor with four parameters to set values for Name, Base, and Height, and Color
// [Code] 3.5 Implement CalculateArea function
// Rule: Please use the formula to calculate the area for a triangle. (hint: use Base and Height).
// [Code] 3.6 Implement IsYellow function
// Rule: if the color is yellow, return true; false, otherwise.
// The color string should be case insensitive
}
public class Program
public static void Main()
// [Code] 1. Create a triangle object
// Input: "Triangle", 8.5, 4.2, "blue" (use one line)
// [Question] What is the value of the area for the created triangle?
// (Use Console.WriteLine and CalculateArea function to find the answer)
// Ans:
// [Question] Is the triangle object's color yellow?
// (Use Console.WriteLine and IsYellow function to find the answer)