Practicing Dictionaries
Fill in the blanks to declaring a new dictionary called book
, also for adding and outputting data. Use implicit declaration for creating the dictionary.
index
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.Collections.Generic;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
// Declaring a new empty dictionary
___ ___ = new Dictionary<string, string>();
// Adding data to the dictionary
___("name", "The Hobbit");
___("author", "J. R. R. Tolkien");
___("publication date", "21 September 1937");
// Outputting data
Console.WriteLine("Book Name: " + ___);
Console.WriteLine("Author: " + ___);
Console.WriteLine("Publication Date: " + ___);
}
}
}
123456789101112131415161718192021222324using System; using System.Collections.Generic; namespace ConsoleApp { class Program { static void Main(string[] args) { // Declaring a new empty dictionary ___ ___ = new Dictionary<string, string>(); // Adding data to the dictionary ___("name", "The Hobbit"); ___("author", "J. R. R. Tolkien"); ___("publication date", "21 September 1937"); // Outputting data Console.WriteLine("Book Name: " + ___); Console.WriteLine("Author: " + ___); Console.WriteLine("Publication Date: " + ___); } } }
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 1. Розділ 5
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат