Time for action – creating the word histogram

Follow the given steps:

  1. Create a console application. Call it TagCloud.
  2. Add the following in the Main() method of Program.cs:
    Dictionary<string, int> wordHistogram = new Dictionary<string, int>();
    wordHistogram.Add("Apple",33);
    wordHistogram.Add("Orange",85);
    wordHistogram.Add("Strawberry",20);
    wordHistogram.Add("Watermelon",150);
    wordHistogram.Add("Guava", 52);
    wordHistogram.Add("Grape", 80);
    ShowCloud(wordHistogram);
  3. Copy the Sample Code from the following location and save it as TagCloudData.txt in the in the C:\ drive:

    http://visapi-gadgets.googlecode.com/svn/trunk/termcloud/doc.html

  4. Replace the highlighted part of this file (as shown in the following screenshot) with a place holder !DATA!:

    Delete ...

Get .NET 4.0 Generics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.