Giter Club home page Giter Club logo

decathlon's Introduction

DECATHLON

The project's aim is to calculate the results of a Decathlon competition.

Installation

Java Runtime Environment 8 is required. Click to install.

Project can be run with jar file. If you want to create it from scratch, you should install maven 3 and run mvn package. Jar file is created in target folder.

Usage

Project run from the terminal.

usage: java -jar decathlon.jar -i inputFile.csv -o outputFile.xml

version: 0.0.1

  • -i: mandatory input csv file. Default separator is semicolon ';'. Use -s parameter to change the separator.
  • -o: output file. Output file contains all athletes overall decathlon scores, full names and their place. Output file format is xml.
  • -s: separator character for input csv file. Default is semicolon ';'. It should be one character.
  • -v: print version of the program.
  • -k: verbose output.
  • -h: print this usage information.

Input

Input file is a csv file separated with semicolon. Each row has 11 fields:

  • Full Name
  • 100-meter dash score as seconds
  • Long jump as meter
  • Shot put as meter
  • High jump as meter
  • 400-meter dash as seconds
  • 110m hurdles as seconds
  • Discus throw as meter
  • Pole vault as meter Javelin throw
  • 1500 meter run as format mm:ss

Sample input file is in ìnputs folder.

Output

Output file has all athletes':

  • full name
  • decathlon score
  • place: place is rank in the competition of the athlete. If there are more than same score, place shows rank gap. For example if 3 athletes has same score after first athlete, their places are '2-4'. Athletes are placed according to their names if they share the places.

Sample output file is in sample_outputs folder.

Resources

Click here for Decathlon information and formula calculation.

Formula: INT(A((B-P)*-1)^C) (multiplication by -1 is valid for field event) in which 'INT' operation removes the fractional part of calculating point.

Results are checked with the table under the Benchmark's topic in the wiki. Only High jump and Pole vault's event results for 1000 pts are a bit different. They are required to calculate more sensitive.

For High jump instead of 2.2000, it should be 2.2077. For Pole vault instead of 5.2800, it should be 5.2863.

These results are also checked with this calculator.

Naming Convention

Google naming convention is used in this project.

Benchmark

Decathlon calculator calculates 1,000,000 results in 3.17 seconds on average.

10 individual test is run in computer which has Intel i9-10850K CPU and 16 GB DDR4 2400 MHz RAM.

Test Coverage

There are unit tests in project with using Junit 5 Jupiter. Test coverage results:

  • class coverage: %100
  • method coverage: %100
  • line coverage: %73. When integration tests are included, line coverage is %97.

It is measured with IntelliJ code coverage feature.

Dependencies

  • Java 1.8
  • Maven

Project tested with Apache Maven 3.8.1. Project developed with IntelliJ Ultimate 2021.1.1.

Static Code Analyzer

SonarLint plugin in Intellij and IntelliJ itself static code analyzers are used to check code. All possible issues are fixed.

Licence

Go to file LICENSE.

Author

Halil Ibrahim Oymaci - Senior Software Engineer

decathlon's People

Contributors

hioymaci avatar

Watchers

 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.