diff --git a/index.html b/index.html
new file mode 100644
index 0000000..cde6fff
--- /dev/null
+++ b/index.html
@@ -0,0 +1,19 @@
+
+
+
+
+
+ 03_JavaScript-foundations__loops-conditionals
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/loops-conditionals/conditionals/exercise_00.js b/loops-conditionals/conditionals/exercise_00.js
index 3b9c2ee..31828f3 100644
--- a/loops-conditionals/conditionals/exercise_00.js
+++ b/loops-conditionals/conditionals/exercise_00.js
@@ -8,3 +8,34 @@
7. At the end of the program, print out: "--- Animal check complete ---"
8. Change the animal to different values to make sure it works in all cases
*/
+// exercise1.js
+
+// 1
+
+console.log("--- Animal Checker Program --");
+
+// 2
+
+let animal = "cat";
+
+// 3
+
+if (animal === "cat") {
+ console.log("Meow");
+}
+
+// 5
+
+else if (animal === "dog") {
+ console.log("Woof");
+}
+
+// 6
+
+else {
+ console.log("Must be an alien");
+}
+
+// 7
+
+console.log("--- Animal check complete ---");
diff --git a/loops-conditionals/conditionals/exercise_01.js b/loops-conditionals/conditionals/exercise_01.js
index 763d3cc..b3f5e3d 100644
--- a/loops-conditionals/conditionals/exercise_01.js
+++ b/loops-conditionals/conditionals/exercise_01.js
@@ -7,3 +7,15 @@
HINT: The modulus operator ( % ) is your friend.
*/
+
+// 1
+
+let number = 8;
+
+// 2
+
+if (number % 2 === 0) {
+ console.log(`Number ${number} is even`);
+} else {
+ console.log(`Number ${number} is odd`);
+}
diff --git a/loops-conditionals/conditionals/exercise_02.js b/loops-conditionals/conditionals/exercise_02.js
index 4e7f1e0..05d448d 100644
--- a/loops-conditionals/conditionals/exercise_02.js
+++ b/loops-conditionals/conditionals/exercise_02.js
@@ -4,9 +4,10 @@
Add a comment explaining what is happenning and how to fix it
*/
-
+//The poblem is in the returns, because the first if is completly and return ""You are in elementary school, kid." this text is printed but no is true the solution is or change the order to major if comaprison to minor o delete de equals "
const age = 20;
+function checkAge(){
if (age < 3) {
console.log("You're just a baby!");
return;
@@ -25,3 +26,7 @@ if (age >= 18) {
}
console.log("What? How did this happen!?");
+return
+}
+
+checkAge()
diff --git a/loops-conditionals/loops/exercise_00.js b/loops-conditionals/loops/exercise_00.js
index 5558dc8..b695c42 100644
--- a/loops-conditionals/loops/exercise_00.js
+++ b/loops-conditionals/loops/exercise_00.js
@@ -3,3 +3,19 @@
2. Create a for loop that will print out all the odd numbers between 10 and 40.
*/
+
+//1
+
+for (let i = 10; i <= 40; i++) {
+ if (i % 2 === 0) {
+ console.log(i);
+ }
+}
+
+//2
+
+for (let i = 10; i <= 40; i++) {
+ if (i % 2 !== 0) {
+ console.log(i);
+ }
+}
diff --git a/loops-conditionals/loops/exercise_01.js b/loops-conditionals/loops/exercise_01.js
index a2ad819..97209eb 100644
--- a/loops-conditionals/loops/exercise_01.js
+++ b/loops-conditionals/loops/exercise_01.js
@@ -6,3 +6,14 @@
* If it is greater than or equal to 5, print "Logged In with (number)!"
* If it is less than 5, print "Logged Out with (number)!"
*/
+
+for (let i = 1; i <= 10; i++) {
+
+ let number = (Math.random() * 10) | 0 + 1;
+
+ if (number >= 5) {
+ console.log(`Logged In with (${number})!`);
+ } else {
+ console.log(`Logged Out with (${number})!`);
+ }
+}
diff --git a/loops-conditionals/loops/exercise_02.js b/loops-conditionals/loops/exercise_02.js
index d4f851e..9485a54 100644
--- a/loops-conditionals/loops/exercise_02.js
+++ b/loops-conditionals/loops/exercise_02.js
@@ -18,3 +18,19 @@
You made it!
All done!
*/
+
+for (let i = 1; i <= 100; i++) {
+ if (i % 10 === 0) {
+ console.log(`Checkpoint! ${i}`);
+ }
+
+ if (i === 50) {
+ console.log("Halfway there!");
+ }
+
+ if (i === 100) {
+ console.log("You made it!");
+ }
+}
+
+console.log("All done!");
diff --git a/loops-conditionals/while/exercise_00.js b/loops-conditionals/while/exercise_00.js
index 3f5ae8a..85f40a4 100644
--- a/loops-conditionals/while/exercise_00.js
+++ b/loops-conditionals/while/exercise_00.js
@@ -7,3 +7,27 @@
HINT: Be careful of an infinite loop!
*/
+//1
+
+let loggedIn = false;
+let attempts = 0;
+
+//2
+
+while (!loggedIn) {
+ //3
+
+ console.log("Incorrect login credentials");
+
+ //4
+
+ attempts++;
+ if (attempts === 3) {
+ loggedIn = true;
+ }
+}
+
+//5
+
+console.log("Successfully logged in!");
+
diff --git a/loops-conditionals/while/exercise_01.js b/loops-conditionals/while/exercise_01.js
index 6c85b8e..8296b18 100644
--- a/loops-conditionals/while/exercise_01.js
+++ b/loops-conditionals/while/exercise_01.js
@@ -3,3 +3,23 @@
2. Create a while loop that will print out all the odd numbers between 10 and 40.
*/
+
+// 1
+
+let number = 10;
+while (number <= 40) {
+ if (number % 2 === 0) {
+ console.log(number);
+ }
+ number++;
+}
+
+// 2
+
+number = 10;
+while (number <= 40) {
+ if (number % 2 !== 0) {
+ console.log(number);
+ }
+ number++;
+}
diff --git a/loops-conditionals/while/exercise_02.js b/loops-conditionals/while/exercise_02.js
index 6843abf..d1e8746 100644
--- a/loops-conditionals/while/exercise_02.js
+++ b/loops-conditionals/while/exercise_02.js
@@ -18,3 +18,17 @@
You made it!
All done!
*/
+
+$counter = 1;
+
+while ($counter <= 100) {
+
+ if ($counter % 10 == 0) {
+ echo "Checkpoint! $counter\n";
+ }
+
+ if ($counter == 50) {
+ echo "Halfwy there!\n";
+ }
+
+