Giter Club home page Giter Club logo

numeromans's Introduction

Hello, my name is
Lavínia Beghini
and I am

Spotify Spotify LinkedIn WhatsApp StackOverflow Discord

About me

  • 🚀 Software Engineer
  • 🎓 Graduating at Computer Information Systems
  • 💾 Computer Techinician
  • ✈️ Informatics Exchange Student

numeromans's People

Contributors

lbeghini avatar

Watchers

 avatar

numeromans's Issues

Write README.md

Information:

  • description of the problem
  • description of how the problem was solved
  • instructions how to run the code
  • license

Create route to Arabic Numeral

Create a route to test the application, where it receives a character and return the response in JSON format.

Route example

http://url:{port}/arabic?character=10

Create function to convert Roman Numeral

Receive a string with a roman numeral, like CCXII, and convert it to its arabic numerals, 212.

Considering the roman characters and its values:

Character Value
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
  • For each character on a string, convert it to its value and sum them all.
  • If the value of the next character is bigger, then subtract instead of sum

Not allowed operations

  • any other character that does not belong to the roman numeral character list
  • more than 3 repetitions of any character
  • multiple repetition of the characters: [ V, L, D ]
  • multiple subtractions of the characters: [ I, X, C ]

Setup Express

Install express

npm i -S express

and its types:

npm i -D @types/express

Create route to Roman Numeral

Create a route to test the application, where it receives a character and return the response in JSON format.

Route example

http://url:{port}/roman?character=X

Configure TypeScript

Install and configure typescript with:

npm i -D typescript ts-node

and

npx typescript --init

Update the tsconfig.json to configure the rootDir and outDir

Configure linter

Install eslint configured to airbnb:

npx eslint --init

Install prettier

npm install --save-dev --save-exact prettier

Allow four M on string validation

To convert the biggest roman number, four Ms are needed:

MMMCMXCIX

The validation that asserts only 3 character occurrences of each letter must have an exception if the character requested is M.

Setup Nodemon

Install nodemon

npm i -D nodemon

Then configure the server.

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.