Coder Social home page Coder Social logo

mmalinova / bulgariandescriptionofagivennumber Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 20 KB

Bulgarian description of a given number is a simple Java console application that describe number with cyrillic alphabetical words.

Java 100.00%
bulgarian description number number-converter number-recognition number-representation number-reader

bulgariandescriptionofagivennumber's Introduction

Bulgarian description of a given number as input

Bulgarian description of a given number is a simple Java console application that describe number with cyrillic alphabetical words.

How does it work?

  • Receive an INTEGER number from the console as input(at the range -2,147,483,647 - +2,147,483,647);
  • Describe it with words from cyrillic alphabet and print on the console or write into a file.

Example

12 -> дванадесет
999 -> деветстотин деветдесет и девет
1234567 -> един милион двеста тридесет и четири хиляди петстотин шестдесет и седем

How does it is implemented?

  1. constants package contains two type of messages:
    • ExceptionMessages - for some type of errors;
    • OutputMessages - for printing on the console or writing to the file.

It is good practice separating all string values into separate classes to make them easier to translate if necessary.

  1. core package contains the main business logic of the program. It has an interface and two classes:

    • ControllerImpl - process the number according number of digits that contains. Split the number of its constituent digits and processes them. If we think about it, we can easily conclude that each number is composed of the digits from 0 to 9. Moreover, in addition to the range of possible values, here we take into account whether the number is positive or negative;
    • EngineImpl - take the number from the console and make some basic validations. When it is checked, and it is OK, call the appropriate method from the ControllerImpl class.
  2. io package contains two interfaces and two classes:

    • ConsoleReader - read the input;
    • ConsoleWriter - print the output.

bulgariandescriptionofagivennumber's People

Contributors

mmalinova 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.