Coder Social home page Coder Social logo

git-js-pairing-lab-2's Introduction

Intro to Git and JavaScript Pairing Lab

The purpose of this lab is to get you and your partner familiar with git, specifically, how to:

  • Fork a repository
  • git clone down a remote repository
  • git add to stage and git commit to commit changes
  • git push to push up commited changes from a local repo to a remote repo
  • git pull to pull down changes from a remote repo to a local repo
  • Use git to work collaboratively on a shared code base!

Instructions

Remember, paired programming means both partner are always looking at, and working off of the same screen! When you are the driver, you group should be working off your computer. And when you switch, you should be working off your partner's computer. By doing so, you will get practice with push and pull using git!

  1. You will work in groups of two (no more than three) to implement various JavaScript functions.
  2. One group member, Partner A, will fork this repository. Only one group memebr should fork the repo. Partner B does not need to fork anything.
  3. In the forked repository, Partner A needs to add Partner B as a collaborator. This means that both groups members will have read and write (edit) access to the forked repo.
  4. Both partners should git clone the forked repo to their AWS Cloud9 using SSH.
  5. Partner A will drive first with Partner B being the navigator. Partner A will implement the first function, then stage, commit, and push the changes up to the remote repo (make sure you are in the correct folder in the terminal).
  6. Double check the remote repo on Github to ensure the latest commit was successfully pushed up.
  7. Then, it will be Partner B's turn to drive and Partner A will be the navigator. Partner B needs to git pull down the latest commit (make sure you are in the correct folder in the terminal). Once the the code for the first function has been pulled down, Partner B will implement the second function, then push their changes up.
  8. Continue switching driver-navigator roles for every function, with Partner A implementing all the odd numbered questions and Partner B implementing the even numbers questions. Every time you push up a commit, your partner will need to pull down the changes to their local repo.

Problems

Be sure to test your functions as you write them! You can invoke the functions after they have been implemented or use console.log to print out their return value.

  1. Write a function OneHundredToFive that console logs all numbers starting from 100 down to 5.

  2. Write a function absoluteValue that returns the absolute value of a number. If the value is not a number, it returns null.

absoluteValue(-4)     //returns 4
absoluteValue(7.33)   //returns 7.33
absoluteValue("hi")   //returns null
  1. Write a function multiplesOfFourOrSeven that console logs all positive numbers to 100 if that number is either a mulitple of 4 or a mutliple of 7.

4, 7, 8, 12, 14, 16, 20, 21, 24, 28, ...

  1. Write a function square that takes in an integer parameter and returns the square of the number unless that number is a perfect square, in which case, return the square root of the number instead!
square(5)    //return 25
square(9)    //return 81
square(25)   //return 5 because 25 is a perfect square with a root of 5
square(36)   //return 6 because 36 is a perfect square with a root of 6.

git-js-pairing-lab-2's People

Contributors

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