Code Monkey home page Code Monkey logo

conditionals's Introduction

Task

In this task, you'll create a calculator that has two numbers and an operation, and the calculator will perform the operation on those two numbers.

You'll create an integer variable that contains the first number, another integer variable that contains the second number, and a third string variable that contains the operation.

Example, the two numbers could be 3 and 5, and the operation could be "+", then the calculator will add 3 and 5, and print to the console 3 + 5 = 8.

Task Steps

  1. Fork and clone this repository
  2. Open the repo folder in Visual Studio Code.
  3. In calculator.js, create an integer variable for the first number.
  4. Create a second integer variable for the second number.
  5. Create a third string variable for the operation (addition "+", subtraction "-", multiplication "*", or division "/").
  6. Use if-statements to check which operation the third variable has.
  7. Perform the mathematical operation on the two numbers, and print the result to the console.

Submission

To submit your work, simply push your code to GitHub.

Steps

After finishing the task and verifying your work, follow these steps to push your code to GitHub:

  1. Navigate to project root (where calculator.js is).
  2. Run the command git add .
  3. Run git commit -m "Solved the Conditionals task".
  4. Push to GitHub: git push.

conditionals's People

Contributors

themshary avatar emquex avatar lailz 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.