Code Monkey home page Code Monkey logo

moreum-assesment's Introduction

Assignment

Please create a simple application with the specifications below. The product should be a basic document generator with template support.

  • You are free to choose the language and the technology you are comfortable with.
  • You can write a desktop, console or web application.
  • The application must use a single template file. The template must not be hard-coded. Example template is given below.
  • App must accept a CSV data file from the user. Example below.
  • App must read all the lines from the CSV file and parse the data.
  • For every line in the data file, app must fill the placeholders in the template file and create a separate document and save it on the disk.
  • App must not assume hard-coded folder paths or file names. For these, user input or configuration files are acceptable solutions.
  • App should not crash or display unhandled error messages for missing or invalid data. Any errors should be reported to the user in a friendly way.
  • App should not have issues with Turkish characters in the template or data (support UTF-8).
  • Ideally, user should be able to compile and run the application without making changes to source code.

Template File

The template file is the empty text document with placeholders for data fields. An example is given below. This template can be packed along with the source code, but it must not be hard-coded into the program. Any changes to the template should not break the program. This includes changing of fixed text or removal of placeholders.

Konu: {TARIH} tarihli faturanız.

Sayın {AD} {SOYAD}, {FATURANO} numaralı hizmet faturanız ekte gönderilmiştir. Bu dönem için fatura tutarınız: {TUTAR} TL.

Saygılarımızla,

The words in brackets are placeholders. The app must replace these with the data extracted from the data files, except for the {TARIH} field. This field must be filled with the current date.

If there are unrecognized placeholders in the template file, they should be ignored.

Data File

The data file contains the field values: One line for each customer. It is a CSV (comma separated value) file saved from Excel:

123456;Ahmet;Cingöz;34
234567;Ali Fuat;Bilge;45
345678;Ayla;Kaplan;19
456789;Süheyla ;Akça Oğul;72

Format of the data file is fixed. Each line contains four fields, separated with semicolons. The fields are FATURANO, AD, SOYAD and TUTAR in order.

Expected Output

Your app should read the data file, merge the fields into the template and create a separate output file for every line. FATURANO must be used for the filename and the extensions must be TXT. For the example above, your app should create four files:

123456.txt
234567.txt
345678.txt
456789.txt

Each output file must contain text merged from the template file. For example, 456789.txt file must contain the following:

Konu: 15.10.2014 tarihli faturanız.

Sayın Süheyla Akça Oğul, 456789 numaralı hizmet faturanız ekte gönderilmiştir. Bu dönem için fatura tutarınız: 72 TL.

Saygılarımızla,

Your app must not assume that data file will contain four lines. App must be able to handle data files with only one line or a hundred lines.

Your app must not crash if the format of the data file is incorrect. Instead, it should try to display appropriate warnings to the user.

Notes

  • Sample template and data files are provided with this document. These files are saved with UTF-8 encoding.
  • Keep in mind that your application will be tested with different templates (with similar format) and data files (both valid and invalid).
  • You can use code snippets found on Internet, but you must put reference comments above them, including the source web address. Also, make sure you have a thorough understanding of such code because you may be asked to explain or modify your code for a final evaluation.
  • Commented and clean code is always a plus.
  • Unexpected compilation or runtime errors are always a minus.
  • You can add extra useful features not specified in this document. These too will be considered a plus.

moreum-assesment's People

Contributors

enesaltun avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.