Giter VIP home page Giter VIP logo

input-grid-task's Introduction

Setup

You may fork these repo or download a local copy.

With React

If you'd like to use React, this repo is set up with create-react-app.

  1. Fork or download a local copy of this repo.
  2. Run yarn in the repo root.
  3. cd into summing-grid and run yarn to install dependencies.
  4. Run scrips from summing-grid/package.json to test or run your application.

With your own framework

You may use a framework of your choice to complete this task. The root package.json in this repo can be adjusted to install whatever dependencies you need.

Submission

For github forks

Commit and push your code to your forked repo. Open a pull request against this repo and let us know.

For downloads

Send a zip file of your completed exercise to your contact at CB Insights.


Your task

Your task will be to create a 1x4 flexible grid. The first 3 spaces in the grid should contain input fields that accept numbers. The 4th space in the grid will display the sum of the numbers in the first 3 spaces.

The grid

The grid should have 1 row and 4 columns. The width of each column should be 25% of the window width. This width must be maintained even if the page is resized. The border of the grid must be 1px black.

Perform the following operations based on the value of window size:

If the window size is less than 720px, then the 1x4 flexible grid becomes a 2x2 grid, that is, the 3rd and 4th columns slide down onto the 2nd row. If the window size is less than 360px, then the 1x4 flexible grid becomes 4x1 grid, that is, each column slides under the one before it. The 2nd column slides under the 1st, the 3rd slides under the 2nd, and the 4th slides under the 3rd.

The input fields

The first 3 input fields should each accept a number. Then write code which sums the 3 numbers together and displays the sum in the 4th field. Then write code which formats the sum to the nearest 3 digit number (e.g. 1234567 as 1.23M or 123456 as 123K).

Extra Credit

Add validation to the input fields to ensure that the entered values are numbers. Also ensure that entering non-number values does not break the other functionality or cause any errors. Add some unit tests (you may want to install additional node modules).

As you build this app, consider...

  • How data should flow between components
  • Which components could be built to be reusable
  • How to style the grid so that it's easy to add or remove input cells
  • How number formatting should handle edge cases

input-grid-task's People

Contributors

akdetrick avatar mahdt avatar pmowrer 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.