Assignment 1
Assignment 1
1. Download and install an IDE for C# for your platform, e.g. Visual Studio.
2. If you have access to a Windows computer download LINQPad:
https://www.linqpad.net
3. Take “A Tour of the C# Language”:
https://docs.microsoft.com/en-us/dotnet/articles/csharp/tour-of-csharp
4. Read the “Introduction to LINQ Queries (C#)”:
https://docs.microsoft.com/en-us/dotnet/articles/csharp/programming-guide/c
oncepts/linq/introduction-to-linq-queries
5. LINQ Cheat Sheet (attached)
Assignment
In this assignment, you will use C# and LINQ to iterate files, to query, group and order
data, and to create an XML document based on that data.
Implementation
You must follow these implementation guidelines:
1. Create a C# console application. You can use the template from the Lecture
Notes.
This application has two command line arguments: A path to a folder and a
path to an HTML report output file. The application collects all files with the
same extension (converted to lower case) and determines for each extension,
i.e. file type, the number of files and the total size of all files of this type.
2. Implement a class with the following 4 static functions:
static IEnumerable<string>
EnumerateFilesRecursively(string path)
Enumerate all files in a given folder recursively including the entire sub-folder
hierarchy. You can use System.IO.Directory. You could use the
generator pattern (yield keyword) to implement the iterator.
Deliverable
1. Your source code.
2. A report file generated by your application.
Rubric