Skip to content

butulkus/louvuidatecode

Repository files navigation

"LV" Date Code

An intermediate level task for practicing string parsing and data conversion.

LV (multinational corporation specializing in luxury goods) handbags have "date codes" with information about a handbag manufacturing location and date. In the task you have to implement "date code" generation and parsing algorithms for different "date code" formats.

Read more about LV's "date codes" before starting work on the task (Wayback Machine's copy).

How to Decode a Date Code

Get the Project

Complete the Task

The first group of overloaded methods should generate a "date code" string using a two-letter factory location code, a manufacturing year and a manufacturing month. The methods are overloaded. The one method should be implemented with "uint" parameters type, the second method should have "DateTime" parameter type.

  1. Implement the GenerateEarly1980Code(uint, uint) and GenerateEarly1980Code(DateTime) methods in the DateCodeGenerator.cs file.
  2. Implement the GenerateLate1980Code(string, uint, uint) and GenerateLate1980Code(DateTime) methods in the DateCodeGenerator.cs file.
  3. Implement the Generate1990Code(string, uint, uint) and Generate1990Code(DateTime) methods in the DateCodeGenerator.cs file.
  4. Implement the Generate2007Code(string, uint, uint) and Generate2007Code(DateTime) method in the DateCodeGenerator.cs file.

ISO-8601: Use EpochConverter for visualizing week numbers (see week number for 1st Jan for 2016 year). It is worth noting that Epoch Converter works according to the ISO-8601 standard, which applies special rules for calculating days, weeks and years.

Then, implement a helper method that should return a list of countries that have factories with specified factory location code. Two or more countries may have factories with the same location code (for example, France and USA have a factory with the "SD" location code). Countries are implemented as enumeration type values.

  1. Implement the GetCountry method in the CountryParser.cs file.

The next group of methods should parse a "date code" string and return the manufacturing data in out parameters.

  1. Implement the ParseEarly1980Code method in the DateCodeParser.cs file.
  2. Implement the ParseLate1980Code method in the DateCodeParser.cs file.
  3. Implement the Parse1990Code method in the DateCodeParser.cs file.
  4. Implement the Parse2007Code method in the DateCodeParser.cs file.

Check out the section "See also" for the methods and classes you may use to solve the task.

Fix Compiler Issues

Additional style and code checks are enabled for the projects in this solution to help you maintaining consistency of the project source code and avoiding silly mistakes. Review the Error List in Visual Studio to see all compiler warnings and errors.

If a compiler error or warning message is not clear, review errors details or google the error or warning code to get more information about the issue.

Save Your Work

See also

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages