|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace www.askbargains.com
{
namespace Strategy
{
public class EyeDoctor : Doctor
{
const int examFee = 80;
public override void ExamineKid()
{
//exam starts
Console.WriteLine("Dr. WANG (Eye doctor) starts examination for " + aKid.Name + " ....");
//step 1
Console.WriteLine("Distance Vision Eye Test in process...");
//step 2
Console.WriteLine("Near Vision Test in process...");
//step 3
Console.WriteLine("Amsler Grid Eye Test in process...");
//step 4
Console.WriteLine("Exam completed for" + aKid.Name);
}
public override void GenerateBill()
{
Console.WriteLine("Generating the biling info...");
Console.WriteLine("Examination Fee : $" + examFee);
//apply the discount for kids
switch (aKid.Age)
{
case 3:
Console.WriteLine("Extra 25% discount is applied for " + aKid.Name);
Console.WriteLine("Total due: " + examFee * (1 - 0.25));
break;
case 4:
Console.WriteLine("Extra 25% discount for " + aKid.Name);
Console.WriteLine("Total due: " + examFee * (1 - 0.15));
break;
default:
Console.WriteLine("Extra 10% discount for " + aKid.Name);
Console.WriteLine("Total due: " + examFee * (1 - 0.10));
break;
}
}
public override void CreateReport()
{
Console.WriteLine("Writing the report...");
//I hardcode the condition here for an demo here.
if (aKid.Name == "Elizabeth")
Console.WriteLine(aKid.Name + " needs the follow up check. please contact us...");
else
Console.WriteLine(aKid.Name + " is fine. Thanks. ");
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.