From aa7d361a05bb259c32dde73df03f0537afd08f0c Mon Sep 17 00:00:00 2001 From: Jeremy Taubman <56704648+taubman33@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:29:42 -0500 Subject: [PATCH 01/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba50551..69b4e92 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## JSDR213 +## SEBR 0116 # Conditionals and Loops Lab From e77ed243d8291565ddc015db2ec2bbf13fc96a0e Mon Sep 17 00:00:00 2001 From: Jeremy Taubman <56704648+taubman33@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:21:59 -0500 Subject: [PATCH 02/11] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 69b4e92..1644433 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,12 @@ Run a For Loop that starts at 0, ends at 10, and logs each number squared (your Create an array of foods, then loop through them. Run a conditional in your loop with the charAt[0] method so that you are only logging to your console foods that start with the letter F -## 8 - Even and Odd Numbers +## Bonus 8 - Even and Odd Numbers Run a loop that goes between 20 and 40, but only logs Even numbers. Then create a new loop that does the same for Odds -## 9 - FizzBuzz! + +## Bonus 9 - FizzBuzz! A coding classic, run a loop that counts and logs every number between 1 and 30. If a number is divisible by 3, log "Fizz", if it is divisible by 5, log "Buzz", and if it is divisible by 3 and 5, log "FizzBuzz" From efe297dcd87368aa43481d886b0293d96608b8c6 Mon Sep 17 00:00:00 2001 From: Zekkune Date: Wed, 17 Jan 2024 16:34:35 -0500 Subject: [PATCH 03/11] added a js file --- script.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 script.js diff --git a/script.js b/script.js new file mode 100644 index 0000000..e69de29 From be186a80a916dbe4f0ddfa225f2fa7fa86b09833 Mon Sep 17 00:00:00 2001 From: Zekkune Date: Wed, 17 Jan 2024 18:32:04 -0500 Subject: [PATCH 04/11] 1 - Weather Report --- script.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/script.js b/script.js index e69de29..35ca5d4 100644 --- a/script.js +++ b/script.js @@ -0,0 +1,8 @@ +let temperature = 0 + +if (temperature > 75) { + console.log("its warm") + +} else { + console.log("its cold") +} \ No newline at end of file From fce4334f288062a8d40dcbe9164281cad059cebc Mon Sep 17 00:00:00 2001 From: Zekkune Date: Wed, 17 Jan 2024 18:47:54 -0500 Subject: [PATCH 05/11] 2 - team-player --- team-player.js | 7 +++++++ script.js => weather-report.js | 0 2 files changed, 7 insertions(+) create mode 100644 team-player.js rename script.js => weather-report.js (100%) diff --git a/team-player.js b/team-player.js new file mode 100644 index 0000000..311e718 --- /dev/null +++ b/team-player.js @@ -0,0 +1,7 @@ +const myTeam = ['Jordan', 'Aubrey', 'Terry', 'Dick', 'Bucky', 'Chris', 'Corey', 'Trey', 'Marley'] + +if (myTeam.length > 9) { + console.log("Play ball!") +} else { + console.log("not enough players") +} \ No newline at end of file diff --git a/script.js b/weather-report.js similarity index 100% rename from script.js rename to weather-report.js From 987d34419bb59fb02fbb83b4efb068b6391ffaab Mon Sep 17 00:00:00 2001 From: Zekkune Date: Wed, 17 Jan 2024 19:02:45 -0500 Subject: [PATCH 06/11] 3 - grade-assigner --- grade-assigner.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 grade-assigner.js diff --git a/grade-assigner.js b/grade-assigner.js new file mode 100644 index 0000000..fcac4a4 --- /dev/null +++ b/grade-assigner.js @@ -0,0 +1,15 @@ +let grade = 90 + +if (grade >= 90) { + console.log('Wow! you got an A!') +} else if (grade <= 89 && grade >= 80) { + console.log('you got a B') +} else if (grade <= 79 && grade >= 70) { + console.log('you got a C') +} else if (grade <= 69 && grade >= 65) { + console.log('you got a D') +} else if (grade < 65) { + console.log('Sorry, you failed...') +} else { + console.log('Please enter a valid grade!') +} \ No newline at end of file From dfb2422386ab39b5b3750fe38d6d517802bd65fd Mon Sep 17 00:00:00 2001 From: Zekkune Date: Wed, 17 Jan 2024 19:25:22 -0500 Subject: [PATCH 07/11] 4 - ATM --- ATM.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 ATM.js diff --git a/ATM.js b/ATM.js new file mode 100644 index 0000000..208f62e --- /dev/null +++ b/ATM.js @@ -0,0 +1,40 @@ +let checkingsAccount = 90 +let savingsAccount = 7600 +let action = 'transferToChecking' + +switch(action) { + case 'withdraw': + checkingsAccount = checkingsAccount - 100 + console.log(`Checkings: ${checkingsAccount} + Savings: ${savingsAccount} + `) + break; + + case 'deposit': + checkingsAccount = checkingsAccount - 100 + + 100 + console.log(`Checkings: ${checkingsAccount} + Savings: ${savingsAccount} + `) + break; + + case 'transferToSavings': + checkingsAccount = checkingsAccount - 100 + savingsAccount = savingsAccount + 100 + console.log(`Checkings: ${checkingsAccount} + Savings: ${savingsAccount} + `) + break + + case 'transferToChecking': + savingsAccount = savingsAccount - 100 + checkingsAccount = checkingsAccount + 100 + console.log(`Checkings: ${checkingsAccount} + Savings: ${savingsAccount} + `) + break + + default: + console.log('invalid action') + +} From 1f5608f0827d2edefef4313450fce643e4563273 Mon Sep 17 00:00:00 2001 From: Zekkune Date: Wed, 17 Jan 2024 19:36:01 -0500 Subject: [PATCH 08/11] high-five.js --- high-five.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 high-five.js diff --git a/high-five.js b/high-five.js new file mode 100644 index 0000000..23497e5 --- /dev/null +++ b/high-five.js @@ -0,0 +1,6 @@ +let fingersTouched = 0 + +for (let i = 0; i <= 50; i++) { + fingersTouched = fingersTouched + 5 + console.log(fingersTouched) +} \ No newline at end of file From 7f41b2feeb2b489db4a35900c633b286afa5ed24 Mon Sep 17 00:00:00 2001 From: Zekkune Date: Wed, 17 Jan 2024 19:59:18 -0500 Subject: [PATCH 09/11] 7 - foods --- foods.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 foods.js diff --git a/foods.js b/foods.js new file mode 100644 index 0000000..a06cca6 --- /dev/null +++ b/foods.js @@ -0,0 +1,7 @@ +let foods = ['fudge', 'cheese', 'strawberrie', 'pinneapple', 'burrito', 'pizza', 'funnel cake', 'falafel', 'french omlet'] + +for (let i = 0; i < foods.length; i++) { + if (foods[i].charAt(0) === 'f') { + console.log(foods[i]) + } +} \ No newline at end of file From 8b6ae999e28396921cf027fe6f02f21eea3ca255 Mon Sep 17 00:00:00 2001 From: Zekkune Date: Thu, 18 Jan 2024 09:26:17 -0500 Subject: [PATCH 10/11] HW submission --- foods.js | 4 +++- high-five.js | 7 ++----- weather-report.js | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/foods.js b/foods.js index a06cca6..369334b 100644 --- a/foods.js +++ b/foods.js @@ -4,4 +4,6 @@ for (let i = 0; i < foods.length; i++) { if (foods[i].charAt(0) === 'f') { console.log(foods[i]) } -} \ No newline at end of file +} + +// you only need [i] when inside a function or loop \ No newline at end of file diff --git a/high-five.js b/high-five.js index 23497e5..622c787 100644 --- a/high-five.js +++ b/high-five.js @@ -1,6 +1,3 @@ -let fingersTouched = 0 - -for (let i = 0; i <= 50; i++) { - fingersTouched = fingersTouched + 5 - console.log(fingersTouched) +for (let i = 0; i <= 50; i+=5) { + console.log(i) } \ No newline at end of file diff --git a/weather-report.js b/weather-report.js index 35ca5d4..858e94b 100644 --- a/weather-report.js +++ b/weather-report.js @@ -2,7 +2,6 @@ let temperature = 0 if (temperature > 75) { console.log("its warm") - } else { console.log("its cold") } \ No newline at end of file From 66832c50e278d72e8777262a0944e3c1ef21405b Mon Sep 17 00:00:00 2001 From: Zekkune Date: Thu, 18 Jan 2024 09:28:46 -0500 Subject: [PATCH 11/11] forgot 1 of the HW's --- hip-hop.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 hip-hop.js diff --git a/hip-hop.js b/hip-hop.js new file mode 100644 index 0000000..758a80e --- /dev/null +++ b/hip-hop.js @@ -0,0 +1,3 @@ +for (let i=0; i<=10; i++) { + console.log(i**2) +} \ No newline at end of file