using System;
using System.Collections.Generic;
namespace ProgrammingLanguagesDictionary
{
class Program
{
static void Main(string[] args)
{
// Create a dictionary of programming languages and their descriptions
Dictionary<string, string> languageDict = new Dictionary<string, string>();
// Add programming languages with descriptions
languageDict.Add("Python", "High-level, interpreted language great for data science and web development");
languageDict.Add("JavaScript", "Essential language for web development, runs in browsers and servers");
languageDict.Add("Java", "Object-oriented language known for 'write once, run anywhere' philosophy");
languageDict.Add("C#", "Microsoft's object-oriented language for .NET framework development");
languageDict.Add("C++", "Powerful system programming language, extension of C language");
languageDict.Add("Ruby", "Dynamic, object-oriented language focused on simplicity and productivity");
languageDict.Add("Go", "Google's language designed for modern distributed systems");
Console.WriteLine("Programming Languages Dictionary:");
Console.WriteLine("=================================");
// Check if specific keys exist
Console.WriteLine("\nChecking if languages exist in dictionary:");
Console.WriteLine("Contains Python: " + languageDict.ContainsKey("Python"));
Console.WriteLine("Contains PHP: " + languageDict.ContainsKey("PHP"));
// Display all programming languages and their descriptions
Console.WriteLine("\nComplete Programming Languages Dictionary:");
foreach (KeyValuePair<string, string> pair in languageDict)
{
Console.WriteLine("Language: " + pair.Key.PadRight(12) + " Description: " + pair.Value);
}
// Display just the keys (language names)
Console.WriteLine("\nJust the programming language names:");
Dictionary<string, string>.KeyCollection keys = languageDict.Keys;
foreach (string key in keys)
{
Console.WriteLine("Language: " + key);
}
// Display just the values (descriptions)
Console.WriteLine("\nJust the descriptions:");
Dictionary<string, string>.ValueCollection values = languageDict.Values;
foreach (string value in values)
{
Console.WriteLine("Description: " + value);
}
Console.WriteLine("\nTotal number of programming languages in dictionary: " + languageDict.Count);
}
}
}