Giter Club home page Giter Club logo

lab-javascript-basic-algorithms's Introduction

Ironhack Logo

JS | Basic Algorithms

Welcome to your first bootcamp exercise at IronHack!

The goal of this exercise is to get you acquainted with the different control structures we have in JavaScript.

Ready?

Introduction

Edit the basic-algorithms.js file with your editor and check the solutions in the developer tools console.

Ready to start?

Requirements

  • Fork this repo
  • Then clone this repo

Submission

  • Upon completion, run the following commands:
$ git add .
$ git commit -m "done"
$ git push origin master
  • Create Pull Request so your TAs can check up your work.

Exercise

Iteration 1: Names and Input

  1. Create a variable hacker1 with the driver's name

  2. Print "The driver's name is XXXX"

  3. Create a variable hacker2 and ask the user for the navigator's name

  4. Print "The navigator's name is YYYY"

Iteration 2: Conditionals

  1. Depending on which name is longer, print:
    • The Driver has the longest name, it has XX characters or
    • Yo, navigator got the longest name, it has XX characters or
    • wow, you both got equally long names, XX characters!!

Iteration 3: Loops

  1. Print all the characters of the driver's name, separated by a space and in capitals ie. "J O H N"

  2. Print all the characters of the navigator's name, in reverse order. ie. "nhoJ"

  3. Depending on the lexicographic order of the strings, print:

  • The driver's name goes first
  • Yo, the navigator goes first definitely
  • What?! You both got the same name?

Bonus Time!

  1. Ask the user for a new string and check if it's a Palindrome. Examples of palindromes:

    • "A man, a plan, a canal, Panama!"
    • "Amor, Roma"
    • "race car"
    • "stack cats"
    • "step on no pets"
    • "taco cat"
    • "put it up"
    • "Was it a car or a cat I saw?" and "No 'x' in Nixon".
  2. Go to lorem ipsum generator and:

  • Generate 3 parragraphs. Store the text in a String
  • Make your program count the number of words in the string
  • Make your program count the number of times the latin word etappears

Extra Resources

lab-javascript-basic-algorithms's People

Contributors

axelgar avatar fontcuberta avatar lluisarevalo avatar sophiahelena avatar tawebbcn 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.