Giter Site home page Giter Site logo

intro-to-node-js-lab's Introduction

Lab - Intro To Node.js

Introduction

In this lab, you will be creating a small Node.js app that can take in input on the command line and give the user the answer they're looking for.

Goal

When you're done, you'll have a small command-line app that other developers can download and run.

Resources

Here are two excellent articles quickly summarizing process.argv:

Dog Age Calculator

It's not actually true that 1 dog year is 7 human years. Nor is the calculation we'll follow quite right—to get a truly accurate picture of a dog's age, you need to take their size into account as well.

But for the purposes of this assignment, you will calculate a dog's real age with the following rules:

  • Year 1 of a dog's life is 15 dog years
  • Year 2 is the equivalent of another 9 years.
  • Every year after that is the equivalent of another 5 years.

Some ages to try to make sure your app works:

  • 1 human year -> 15 dog years
  • 2 human years -> 24 dog years
  • 10 human years -> 64 dog years

Your app will work with a dog's name and age in human years, and return a sentence about their age in dog years. Running node dog-age-calculator-.js Maisie 3 should output: "Your dog, Maisie, is 3 years old, but that's 29 years old in dog years!"

Similarly, node dog-age-calculator.js Ralph 4 will output, "Your dog, Ralph, is 4 years old, but that's 34 years old in dog years!"

intro-to-node-js-lab's People

Contributors

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