Coder Social home page Coder Social logo

currency-to-words's Introduction

Console Program Write in C#

This program is to convert input of numbers into a words, which is passed a number as input and converts this number into words and passes these words as a string output parameter. Such a routine is typically use by a cheque writing program. (In this case is a US Dollar)

Example :

input = "123.45"
ouput =  “ONE HUNDRED AND TWENTY-THREE DOLLARS AND FORTY-FIVE CENTS” 

Output Explanation

  • This program only accept a valid input of number. If it's not valid, then the program will ask you to put a valid input.

    invalid-input

  • Check if input is negative number, if yes then the program will not process it and immediately give an invalid response.

    invalid-negative-number

  • Check if input is 0, if yes then the program just simply response zero.

    zero-response

  • Check if input is a Decimals or Integers by looking for any dot (.) in the input.

    • If there isn't any dot (.), then it going to show the usual response.

    numbers-response

    • If there is a dot (.), then it going to show the usual response follow by decimals number into a cent(s).

    decimals-response


© 2020 Herdanu Yudistira Putra. All right reserved.

currency-to-words's People

Contributors

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