Giter Site home page Giter Site logo

somdipdey / arabic-to-roman-numerals-in-java Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 26 KB

Use this project to convert Arabic numerals to Roman numerals easily and efficiently

Java 100.00%
java java-codes arabic roman roman-numerals roman-number-converter java-files convert-arabic-numerals javac kata bbc

arabic-to-roman-numerals-in-java's Introduction

Arabic-To-Roman-Numerals (Java)

Use this project to convert Arabic numerals to Roman numerals easily and efficiently

Structure of files in this directory:

This is the Root directory ::> bin (contains two subfolders)

-> mainRomanNumeralConversionProgram (contains 4 files)

-> testsForRomanNumeralConversion (contains 4 files)

::> src (contains two subfolders and one README.txt)

-> mainRomanNumeralConversionProgram (contains 4 files)

-> testsForRomanNumeralConversion (contains 4 files)

-> README.txt (More details and further explanation)

Details of the project structure can be found from here --> https://github.com/somdipdey/Arabic-To-Roman-Numerals/blob/master/STRUCTURE-README.txt

bin/MainRomanNumeralConversionProgram

is the sub folder containing program executables for ArabicToRomanNumeralGenerator

bin/TestsForRomanNumeralConversion

is the sub folder containing program executables to test the execution of the solution

src/MainRomanNumeralConversionProgram

is the sub folder containing all the java files for ArabicToRomanNumeralGenerator

src/TestsForRomanNumeralConversion

is the sub folder containing all the java files to test the execution of the solution

The Challenge Solved Here -> Coding Kata - Roman Numerals

In whatever language you prefer, write a class that implements the following interface (example given in Java):

public interface RomanNumeralGenerator {

   public String generate(int number); 
   
}

For example, see the following sample inputs and outputs: 

1 = “I” 

5 = “V” 

10 = “X” 

20 = “XX” 

3999 = “MMMCMXCIX”

----------------------------------------------------------
----------------------------------------------------------

Guide to this solution/project ::::>

In this src folder you will find two Java projects, which solves the aforementioned challenge. The project with name, MainRomanNumeralConversionProgram, implements the RomanNumeralGenerator interface and the Program.java file is the main entry point to that project. Just compile and run the Program.java file to see the implementation in action. Eclipse IDE is used to compile and run these projects, so it is advisable that you use similar IDE to compile and run Program.java file.

In the project named, TestsForRomanNumeralConversion, you will find test cases to check if the implementation of RomanNumeralGenerator interface is correct or not. In this project Program.java is the entry point. So just compile and run the Program.java to check whether all the test cases pass successfully or not.

Note:

Compile and run the Program.java and other associated .java files in src/MainRomanNumeralConversionProgram to see the solution in action.

Compile and run the Program.java and other associated .java files in src/TestsForRomanNumeralConversion to perform tests to check quality of the solution.

To compile the solution using ‘javac’ then use the following command in your terminal:

$ javac -d . Program.java ArabicToRomanNumeralGenerator.java ArabicToRomanNumeralDictionary.java RomanNumeralGenerator.java

—————————————————

To compile the tests for the solution using ‘javac’ then use the following command in your terminal:

$ javac -d . Program.java TestForArabicToRomanNumeral.java TestForLessThanOne.java TestForMoreThanThreeThousandandNineHundredandNinetyNine.java

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.