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
2 changes: 2 additions & 0 deletions .learn/resets/01-Hello_World/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//your code below
console.log("hello world")
4 changes: 4 additions & 0 deletions .learn/resets/02-Print_variables_in_the_console/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
let mySuperVariable = 'hello';
console.log(mySuperVariable);

// your code below
1 change: 1 addition & 0 deletions .learn/resets/03-Multiply_two_values/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Your code below:
3 changes: 3 additions & 0 deletions .learn/resets/04-User_inputed_variables/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let age = prompt('What is your age?');

// Your code below:
5 changes: 5 additions & 0 deletions .learn/resets/05-Constants/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const VERSION = '0.1';

VERSION = '0.9';

console.log(VERSION);
7 changes: 7 additions & 0 deletions .learn/resets/06-String_concatenation/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//Set the values here
let myVar1 = '';
let myVar2 = '';

//Don't change any code below
let theNewString = myVar1+' '+myVar2;
console.log(theNewString);
13 changes: 13 additions & 0 deletions .learn/resets/07-Create_a_basic_HTML/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const a = '</title>';
const b = '</html>';
const c = '<head>';
const d = '</body>';
const e = '<html>';
const f = '</head>';
const g = '<title>';
const h = '<body>';

//Modify this variable
let htmlDocument = 'e+c+g+h+d+a+f+b';

console.log(htmlDocument);
7 changes: 7 additions & 0 deletions .learn/resets/08-Calling_your_first_function/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function isOdd(myNumber)
{
return !(myNumber % 2 == 0);
}

// Your code below:
isOdd()
7 changes: 7 additions & 0 deletions .learn/resets/09-Creating_your_first_function/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function addNumbers(a,b){
// This is the function's body. Write your code here.

}

//Do not change the code below
console.log(addNumbers(3,4));
7 changes: 7 additions & 0 deletions .learn/resets/10-Create_a_new_function/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function shortIntroduction() {
// Complete this function's body and arguments

}

// Fill the gaps with your data in the correct order
console.log(shortIntroduction(" ", " ", " "))
3 changes: 3 additions & 0 deletions .learn/resets/11-Your_first_if/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let total = prompt('How many km are left to go?');

// Your code below:
12 changes: 12 additions & 0 deletions .learn/resets/12-How_much_the_wedding_costs/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
let guests = prompt('How many people are coming to your wedding?');

function getPrice(guests){
let cost = 0;
// Your code here


return cost;
}

let price = getPrice(guests);
console.log('Your wedding will cost '+price+' dollars');
17 changes: 17 additions & 0 deletions .learn/resets/13-Your_first_switch/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
function getColor(selection)
{
switch(selection){
// Add more options here
default:
return false; //returns false because the user picked an unavailable color
break;
}
}

let colorname = prompt('What color do you want?').trim();
let isAvailable = getColor(colorname);

if(isAvailable)
console.log('Good news! That color is available');
else
console.log('We are sorry, that color is not available');
8 changes: 8 additions & 0 deletions .learn/resets/14-Random_numbers/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function getRandomInt()
{
let randomNumber = Math.random();
return randomNumber;
}


console.log(getRandomInt());
6 changes: 6 additions & 0 deletions .learn/resets/15-Rand_from_one_to_six/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function getRandomInt()
{
let randomNumber = Math.random();
return randomNumber;
}
console.log(getRandomInt());
3 changes: 3 additions & 0 deletions .learn/resets/16-Your_first_loop/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
for (let i = 0; i < 100; i++) {
console.log(i)
}
4 changes: 4 additions & 0 deletions .learn/resets/17-Create_a_for_loop/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Declare and write your function here:


standardsMaker();
12 changes: 12 additions & 0 deletions .learn/resets/18-While_loop/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//fix this function:
function startCounting() {
let counter = 100;
while (counter <= 100) {
counter--;
console.log(counter);
}

return counter;
}

startCounting();
26 changes: 26 additions & 0 deletions .learn/resets/19-Random_colors_loop/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function getColor(colorNumber = 0) {
//make sure the parameter is a number and not a string by converting the value to int:
colorNumber = parseInt(colorNumber);
switch (colorNumber) {
case 1: return "red";

case 2: return "yellow";

case 3: return "blue";

case 4: return "green";

default: return "black";

}
}

function getAllStudentColors() {

//your loop here
let exampleColor = getColor(1);
}

//call the function below with the number of students in the class and print on the console
getAllStudentColors();

5 changes: 5 additions & 0 deletions .learn/resets/20-Looping_with_FizzBuzz/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function fizzBuzz() {
// Your code here
}

fizzBuzz();
16 changes: 16 additions & 0 deletions .learn/resets/21-Russian_Roulette/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// firePosition will be the position in which the gun will fire.
let firePosition = 1;

// The output of spinChamber will be a number and it can be passed as a parameter to the fireGun function.
const spinChamber = () => {
let chamberPosition = Math.floor((Math.random() * 6) + 1);
return chamberPosition;
};

// Remove the // below and complete the commented lines
const fireGun = (bulletPosition) => {
// if (... === firePosition) return ("You're dead!");
// else return ("Keep playing!");
};

console.log(fireGun(spinChamber()));
5 changes: 5 additions & 0 deletions .learn/resets/22-The_Beatles/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


//Your code above ^^^

console.log(sing());
1 change: 1 addition & 0 deletions .learn/resets/23-Bottles_of_milk/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Your code here:
38 changes: 38 additions & 0 deletions .learn/resets/24-Javascript_Objects/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
var person = {
name: "John", //String
lastName: "Doe",
age: 35, //Number
gender: "male",
luckyNumbers: [7, 11, 13, 17], //Array
significantOther: person2 //Object, yes, the same variable/object defined after
};

var person2 = {
name: "Jane",
lastName: "Doe",
age: 38,
gender: "female",
luckyNumbers: [2, 4, 6, 8],
significantOther: person
};

var family = {
lastName: "Doe",
members: [person, person2] //Array of objects, don't forget to add Jimmy
};


function addAllFamilyLuckyNumbers(anArray){
let sumOfAllLuckyNumbers = 0; //sumOfAllLuckyNumbers is a number, the sum of all lucky numbers.

//To-Do: loop and add; consider nested loops
//Hint: use the anArray variable to get all of the lucky numbers

return sumOfAllLuckyNumbers;
}

//Enter all your code here:


//Do not make changes below:
console.log(addAllFamilyLuckyNumbers(family.members));
1 change: 1 addition & 0 deletions exercises/01-Hello_World/app.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
//your code below
console.log("Hello World");
2 changes: 2 additions & 0 deletions exercises/02-Print_variables_in_the_console/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ let mySuperVariable = 'hello';
console.log(mySuperVariable);

// your code below
let color = "red";
console.log(color);
5 changes: 4 additions & 1 deletion exercises/03-Multiply_two_values/app.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
// Your code below:
// Your code below:
let variablesAreCool = 2345 * 7323;

console.log(variablesAreCool);
4 changes: 4 additions & 0 deletions exercises/04-User_inputed_variables/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
let age = prompt('What is your age?');

// Your code below:
age = parseInt(age);
age = age + 10;

console.log(age);
4 changes: 2 additions & 2 deletions exercises/05-Constants/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const VERSION = '0.1';
const VERSION = '0.9';


VERSION = '0.9';

console.log(VERSION);
4 changes: 2 additions & 2 deletions exercises/06-String_concatenation/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//Set the values here
let myVar1 = '';
let myVar2 = '';
let myVar1 = 'Hello';
let myVar2 = 'World';

//Don't change any code below
let theNewString = myVar1+' '+myVar2;
Expand Down
2 changes: 1 addition & 1 deletion exercises/07-Create_a_basic_HTML/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ const g = '<title>';
const h = '<body>';

//Modify this variable
let htmlDocument = 'e+c+g+h+d+a+f+b';
let htmlDocument = e+c+g+a+f+h+d+b;

console.log(htmlDocument);
2 changes: 1 addition & 1 deletion exercises/08-Calling_your_first_function/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ function isOdd(myNumber)
}

// Your code below:
isOdd()
console.log(isOdd(45345))
2 changes: 1 addition & 1 deletion exercises/09-Creating_your_first_function/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function addNumbers(a,b){
// This is the function's body. Write your code here.

return a + b;
}

//Do not change the code below
Expand Down
6 changes: 3 additions & 3 deletions exercises/10-Create_a_new_function/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function shortIntroduction() {
function shortIntroduction(name, profession, age) {
// Complete this function's body and arguments

return "Hello! my name is " + name +", my profession is " + profession + ". I am " + age + " years old."
}

// Fill the gaps with your data in the correct order
console.log(shortIntroduction(" ", " ", " "))
console.log(shortIntroduction("Ayelen", "Abogada", "33"))
8 changes: 8 additions & 0 deletions exercises/11-Your_first_if/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
let total = prompt('How many km are left to go?');

// Your code below:

if (total <= 50) {
console.log("I'm parking. I'll see you right now");
} else if (total <= 100) {
console.log("We'll be there in 5 minutes");
} else {
console.log("We still have a bit of driving left to go");
}
20 changes: 19 additions & 1 deletion exercises/12-How_much_the_wedding_costs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,27 @@ let guests = prompt('How many people are coming to your wedding?');
function getPrice(guests){
let cost = 0;
// Your code here


let people = Number(guests);

if (people > 200) {
cost = 20000
}

else if (people <= 200 && people > 100) {
cost = 15000
}

else if (people <= 100 && people > 50) {
cost = 10000
}

else if (people <= 50) {
cost = 4000
}

return cost;

}

let price = getPrice(guests);
Expand Down
Loading