Ant 6729

Ant 6729

  • NA
  • 87
  • 2k

Dictionaries with timespans and messages

Jul 5 2019 1:55 AM
Hello
I try to use dictionaries 
And I would like to know how could I in dictionary use a specific time range to display the appropriate message.
 
For example 
If it's lunchtime, then one message.
If it is morning now, time is something else.
 
My attempt here
 
  1. namespace ConsoleApp1  
  2. {  
  3.   
  4.     class Program  
  5.     {  
  6.         static string Method()  
  7.   
  8.         {  
  9.             Console.WriteLine("The Timespan is : {0}", variable);  
  10.         }  
  11.         static void Main(string[] args)  
  12.         {  
  13.             var greetings = new List<object>() {"Good morning""Good day""Good evenining"};  
  14.             var timePoints = new List<object>() { 9, 12, 15, 22};  
  15.   
  16.             for (int i = 0; i < greetings.Count; i++)  
  17.             {  
  18.                 //System.Console.WriteLine(i + 1 + " Pair:" + "\n" + "C# type inside IL is: " + greetings[i].GetType() + "\n" + timePoints[i].GetType() + "\n");  
  19.             }  
  20.         }  
  21.     }  
  22. }  
 
 
 
 
 

Answers (1)