Skip to content

An exercise designed to learn basic JS algorithms (var, loops, etc...)

Notifications You must be signed in to change notification settings

sarahledu/lab-javascript-basic-algorithms

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

logo_ironhack_blue 7

Lab | JS Basic Algorithms

Welcome to your first bootcamp exercise at Ironhack!

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

Ready?

Introduction

For this pair-programming activity we are going to use a REPL. You can find a REPL that runs in the browser for programming languages as JavaScript in https://repl.it/languages/nodejs

Ready to start?

Requirements

  • Go to repl.it and create an account (or login if you have one)

  • Type this in the Code Editor (left panel)

    console.log("I'm ready!");
  • Press run ►

  • If you can see the message in the right side panel, you are really ready!

Submission

When you are done and you have checked that everything works fine, click on the Share button and copy the link from the Share Link field. Send this link to your TAs so they can check up your work.

Instructions

Iteration 1: Names and Input

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

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

1.3 Create a variable hacker2 with the navigator's name.

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

Iteration 2: Conditionals

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

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

3.2 Print all the characters of the navigator's name, in reverse order. i.e. "nhoJ"

3.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!

Go to lorem ipsum generator and:

  • Generate 3 paragraphs. Store the text in a variable type of string.
  • Make your program count the number of words in the string.
  • Make your program count the number of times the Latin word et appears.

Extra Resources

About

An exercise designed to learn basic JS algorithms (var, loops, etc...)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%