Giter Club home page Giter Club logo

variable-math's Introduction

Variable Math

Write code in the javascript files according to the following descriptions.

future-age.js

Create a variable called age and set its value to your age. Now, write another line of code that logs out a sentence telling you how old you will be in five years.

adder.js

Create two variables, num1 and num2. Store any numbers in the variables.

Below this, add num1 and num2 together and store the result in a new variable (name it whatever you want).

Finlly, log out num1, num2, and sum in a human readable sentence (i.e.: "8 and 5 add to 13").

greeter.js

Create a variable name and store your name in it.

Below this, write a line of code that displays some greeting to that name (i.e.: "Hello Barry!")

remainder.js

Create two variables that each store a positive number (name them anything you want, any positive numbers will do).

Log out how the remainder that is left over when the first number is divided by the second number (i.e.: "the remainder of 7 divided by 3 is 1")

distance.js

Create four variables, x1, y1, x2, and y2 and store numbers in each of them.

Calculate the distance between coordinates (x1, y1) and (x2, y2). Log this distance out to the user in a human readable sentence.

The distance formula along with an example can be found below.

Bonus

quadratic.js

Create three variables, a, b, and c.

Set them to any numbers you please as long as:

  • a is not zero
  • is greater than or equal to 4 × a × c

Now use the quadratic formula (oh no) to calculate two value of two new variables, x1 and x2.

Note: you'll need to do the formula twice. For x1, use a + in place of the ± symbol. For x2, use a -.

variable-math's People

Contributors

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