diff --git a/README.md b/README.md index ba50551..1644433 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## JSDR213 +## SEBR 0116 # Conditionals and Loops Lab @@ -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" diff --git a/script.js b/script.js new file mode 100644 index 0000000..85c3350 --- /dev/null +++ b/script.js @@ -0,0 +1,51 @@ +let Temperature = 80; +if (Temperature > 75) { + console.log("It is warm"); +} else { + console.log("It is cold") +} + +let softballTeamName =["Bill", "John", "Jim", "Tony", "Sam", "Caleb", "Carl", "Phil", "Lance"] +if (softballTeamName.length>=9){ + console.log("Play ball!") +} else{ + console.log("Not enough players") +} + + +let grade = 88; +if ((numericGrade)){ + console.log("Please enter a valid grade"); +if (numericGrade >= 90) { + console.log("A"); +} else if (numericGrade >=80) { + console.log("B"); +} else if (numericGrade >= 70) { + console.log("C"); +} else if (numericGrade >=60) { + console.log("D"); +} else { + console.log("Failing mark"); +} +} + +let checkingAccount = 2000.00 +let savingsAccount = 3000.00 +const actionType = ['Withdraw', 'Deposit', 'Transfer'] +switch(actionType[1]) { + case 'Withdraw': + console.log(`Checking Account: $${checkingAccount - 100}`); + console.log(`Savings Account: $${savingsAccount}`); + break; + case 'Deposit': + console.log(`Checking Account: $ ${checkingAccount + 100.00}`); + console.log(`Savings Account: $${savingsAccount}`); + break; + case 'Transfer': + console.log(`Checking Account: $ ${checkingAccount - 100.00}`); + console.log(`Savings Account: $${savingsAccount + 100.00}`); + break; + default: + console.log('Error: Invalid Entry'); + } +