Code Monkey home page Code Monkey logo

name-num's Introduction

name-num

One of the final projects for a DevOps class I'm taking has the following specification:

There is a requirement to be able to convert an integer into words. For example, 57 needs to be converted into “fifty seven”. The objective of this project is to develop a method which can convert the numbers 1 through 999 to words. If you have time extend the range up to 2 billion. The method needs to be developed using Test Driven Development (TDD). A standalone application is also required which reads a number from the keyboard and prints out its value in words or “Invalid number”. The program should exit when the user enters 0. The application needs to be packaged as an executable jar file using Ant.

While I'm only about halfway through the class (there are about 2.5 weekends yet) and this needs to be an executable jar file packaged with Ant, I figured I'd get a head start and work out the programming logic. Rather than craft everything with pseudo-code only, I realized this would be a great opportunity to practice Python, which I'm also learning, while tackling a real problem.

Once I get closer to the course completion and complete some other projects, I'll translate this from Python to Java.

Incidentally, since this makes use of recursion, it wasn't really possible to stop it from functioning past 2 billion (the extended use case described), nor do I see a reason to. I'm elated to see the script translate 1 trillion as "1 thousand billion". Adding additional period names (I discovered each group of three numbers is called a "period") would be trivial.

There is work to be done.

name-num's People

Contributors

bmsnook avatar

Watchers

James Cloos 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.