Created
September 23, 2019 19:21
-
-
Save mhkoca/359124aae23d108a6593cdf3b1501416 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace DictionaryTraining | |
{ | |
public class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Reporter reporter = new Reporter(); | |
ReportType reportType = ReportType.Monthly; | |
PrepareReport(reportType); | |
Console.ReadLine(); | |
} | |
private static void PrepareReport(ReportType reportType) | |
{ | |
Reporter reporter = new Reporter(); | |
if (reportType == ReportType.Daily) | |
{ | |
reporter.GetDailyReport(); | |
} | |
else if (reportType == ReportType.Weekly) | |
{ | |
reporter.GetWeeklyReport(); | |
} | |
else if (reportType == ReportType.Monthly) | |
{ | |
reporter.GetMonthlyReport(); | |
} | |
else if (reportType == ReportType.Annual) | |
{ | |
reporter.GetAnnualReport(); | |
} | |
} | |
} | |
public class Reporter | |
{ | |
public void GetDailyReport() | |
{ | |
Console.WriteLine("Daily report is preparing..."); | |
} | |
public void GetWeeklyReport() | |
{ | |
Console.WriteLine("Weekly report is preparing..."); | |
} | |
public void GetMonthlyReport() | |
{ | |
Console.WriteLine("Monthly report is preparing..."); | |
} | |
public void GetAnnualReport() | |
{ | |
Console.WriteLine("Annual report is preparing..."); | |
} | |
} | |
public enum ReportType | |
{ | |
Daily, | |
Weekly, | |
Monthly, | |
Annual | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment