Git Product home page Git Product logo

scalaconversion's Introduction

This project contains a Scala script to convert a list of weights from kgs to lbs.

The important part is to not to do any tightly bound static typecasting. It uses Any concept with List in Scala to achieve this.

Scripts Overview:

(1) convertKg2lbs.scala - This file has methods convert_list_to_k(List[Any]), which takes list of any type. This file is found inside src/main/scala.

(2) We basically give two type if inputs to convert_list_to_k, and one is list of weights and other is list of person object. Each person object can have a pair of name and weight (in kgs).

Unit Testing:

Unit Testing is done by script convertSpec.scala. This file is located in src/main/test. It uses ScalaTest framework to test the two input cases discussed in point (2) above.

How to run:

(1) This project can be opened using IntelliJ IDE or similar.

(2) Run the sbt to get the dependencies before you run convertKg2lbs.scala or convertSpec.scala.

scalaconversion's People

Contributors

leninworld avatar

Watchers

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