Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions asignaci-n-2-openbootcamp/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2026 Liliana Yelitza López de Chaparro (https://codepen.io/Liliana-Yelitza-L-pez-de-Chaparro/pen/gbMJqJo)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 6 additions & 0 deletions asignaci-n-2-openbootcamp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Asignación 2 OpenBootCamp

A Pen created on CodePen.

Original URL: [https://codepen.io/Liliana-Yelitza-L-pez-de-Chaparro/pen/gbMJqJo](https://codepen.io/Liliana-Yelitza-L-pez-de-Chaparro/pen/gbMJqJo).

26 changes: 26 additions & 0 deletions asignaci-n-2-openbootcamp/dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Asignación 2 OpenBootCamp</title>


</head>

<body>
JavaScript for Open BootCamp</h1>
</body>
</html><html>
<head>
<title>Example</title>
</head>
<body>
<h1>my second assignment for Open BootCamp</h1>
</body>
</html>
<script src="./script.js"></script>

</body>

</html>
29 changes: 29 additions & 0 deletions asignaci-n-2-openbootcamp/dist/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//********************

// Initial code
let product = {name: 'cargador',
price: 280,
doesItWork: false,
previousOwner: "Bob"
};

for (let i = 0; i < product.length; i++)
{
console.log(`${key}: ${product[key]}`)
}

delete product.previousOwner
product.doesItWork = true

if (product.price > 100) {
product.discountPercentage = 10

console.log(`Tenemos el ${product.name} en venta por $${product.price}, con el ${product.discountPercentage}% de descuento!`);

console.log("Precio sin porcentaje= " + product.price )

totalPorcentaje = product.price * product.discountPercentage / 100
console.log("El monto del 10% es: " + totalPorcentaje)
product.price = product.price - totalPorcentaje;
console.log("El precio con el 10% de descuento es: "+ product.price);
}
10 changes: 10 additions & 0 deletions asignaci-n-2-openbootcamp/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
JavaScript for Open BootCamp</h1>
</body>
</html><html>
<head>
<title>Example</title>
</head>
<body>
<h1>my second assignment for Open BootCamp</h1>
</body>
</html>
29 changes: 29 additions & 0 deletions asignaci-n-2-openbootcamp/src/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//********************

// Initial code
let product = {name: 'cargador',
price: 280,
doesItWork: false,
previousOwner: "Bob"
};

for (let i = 0; i < product.length; i++)
{
console.log(`${key}: ${product[key]}`)
}

delete product.previousOwner
product.doesItWork = true

if (product.price > 100) {
product.discountPercentage = 10

console.log(`Tenemos el ${product.name} en venta por $${product.price}, con el ${product.discountPercentage}% de descuento!`);

console.log("Precio sin porcentaje= " + product.price )

totalPorcentaje = product.price * product.discountPercentage / 100
console.log("El monto del 10% es: " + totalPorcentaje)
product.price = product.price - totalPorcentaje;
console.log("El precio con el 10% de descuento es: "+ product.price);
}
209 changes: 209 additions & 0 deletions lab-js-basic-algorithms/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@

<img src="https://imgur.com/XOS1Vdh.png" width="150px" height="150px">



# LAB | JS Basic Algorithms



Welcome to your first bootcamp exercise at Open Bootcamp!



The goal of this exercise is to get you familiarized with the primitive data structures in JavaScript, which we just covered in the class. Feel free to reference lesson materials and don't limit yourself but be curious and use Google to explore multiple solutions.



Ready?



![qrjeCm](https://user-images.githubusercontent.com/76580/167263489-bd345c02-6c3b-425e-9a9c-96390dea9ba6.gif)



## Introduction




Ready to start?




## Requirements



- Fork this repo

- Clone this repo

- Type this in the *File Tab* (left panel)



```javascript

console.log("I'm ready!");

```

- Save

- Open a terminal and navigate to the directory where the script file is, then issue the following command `node js/index.js`

- If you can see the message in the terminal panel (bottom), you are really ready!



- __After the first iteration, or later at any point, or once you finish, follow the steps for submission.__



## Submission



Upon completion, run the following commands:



```shell

$ git add .

$ git commit -m "done"

$ git push origin master

```

Create Pull Request so that we can check your work. Not all assignments are meant to be reviewed but expect us to randomly review few and give you feedback.



_You should make a PR (stands for Pull Request) as soon as you make any significant change. You shouldn't have to wait until you're completely done with this or any other exercise to make the PR. After you do the first PR, any other time you push the changes (following the previous three steps), your change will appear automatically on the PR and we will be able to check it._



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

![](https://s3-eu-west-1.amazonaws.com/ih-materials/uploads/upload_b2aa98f91affe5d4c5f12f216b069184.png) -->



## Instructions



### Iteration 1: Names and Input



1.1 Create a variable `hacker1` with the driver's name. <br>

1.2 Print `"The driver's name is XXXX"`.<br>

1.3 Create a variable `hacker2` with the navigator's name.<br>

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



### Iteration 2: Conditionals

2.1. Depending on which name [is longer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), print:

<br>

- `The driver has the longest name, it has XX characters.` or <br>

- `It seems that the navigator has the longest name, it has XX characters.` or <br>

- `Wow, you both have 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](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)

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](https://en.wikipedia.org/wiki/Lexicographical_order) of the strings, print: <br>

- `The driver's name goes first.` <br>

- `Yo, the navigator goes first definitely.` <br>

- `What?! You both have the same name?`



### Bonus Time!



#### Bonus 1:

Go to [lorem ipsum generator](http://www.lipsum.com/) 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`](https://en.wiktionary.org/wiki/et#Latin) appears.



#### Bonus 2:

Create a new variable `phraseToCheck` and have it contain some string value. Write a code that will check if the value we assigned to this variable is a [Palindrome](https://en.wikipedia.org/wiki/Palindrome). Here are some 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".

__Hint__: If you use Google to help you to find solution to this iteration, you might run into some solutions that use advanced string or array methods (such as _join()_, _reverse()_, etc.). However, try to apply the knowledge you currently have since you can build pretty nice solution with just using `for` loop, `if-else` statements with some `break` and `continue`... Just sayin' :smiley:



## Extra Resources



- [String - MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)

- [if - MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else)

- [while - MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/while)

- [for - MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for)




__Happy coding!__ :heart:
6 changes: 6 additions & 0 deletions lab-js-basic-algorithms/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Iteration 1: Names and Input
//
// Iteration 2: Conditionals


// Iteration 3: Loops