(3 points)
You are asked to write a console application which allow user manage his/her Payment. Your tasks
include several of following steps:
1. You should create an interface named ITax , which define [ float ComputeTax() ] method, this is
an abstract method (no-code method). (1 point)
2. Your Payment class will inherited ITax. Payment contains only one attribute named [ float Amount
]. Your task is to override the ComputeTax () method such that : tax = 10% of Amount; (1 point)
3. Create an event to notify user when the Amount be edited; (1 point)
Hint:
The main function of your application should look like following (it is not necessary to have exactly the
same code, but this is good enough to test your application):
static void Main(string[] args)
Payment payment = new Payment() { amount = 1000 };
[Link] += notifyAmountChanged; // your handling function
[Link] = 990;
[Link]( “Tax:” + payment. ComputeTax ());
You application should display like following:
Amount changed – old value: 1000, new value : 990
Tax: 99.0