diff --git a/lesson_03/quiz/quiz.yaml b/lesson_03/quiz/quiz.yaml index eb7a5e60c..b4a1de4be 100644 --- a/lesson_03/quiz/quiz.yaml +++ b/lesson_03/quiz/quiz.yaml @@ -22,6 +22,10 @@ quiz: - $2y$10$7TUXmYaJlWnRZTzYR..CsefgVcOZJMGt7ctxyAf.G3obBBFEAB342 - $2y$10$0ghuTDegle177q8VjCgQ2OhManKjotYXrcDT3SLyUF8KvI152Wd0. - $2y$10$JXoeInFy4UzHhi2Lskxzeu7CQ9RprnJgBw9pjAlV.t6zQyJTyy8OK + dylanlafferty: + - $2y$10$acRuI5XyFjj4PLpl3d1xd.ZEG2MsPUpw0aFoP/CmEx14fEhdmxP1i + - $2y$10$E9m5ekFKcrlyQkURGQNaaOPbu8sBn5fDRWEqUbGvuB8oLIhYLufn2 + - $2y$10$ppMDrfmIXbKcj/D6tuLL0uSAzyevGD8bm2PnqriSdKh81iBiRfUlS mercedesmathews: - $2y$10$hRwUbEYSqz761B.cG79T2uYsYPiEtKu.JgD3Aj7.Mofx27TtX5YHa - $2y$10$qE/gXxpq62FEGJOJd9MDA.vpDYLTNSsZbqZLpD/0368CKkcNBzW1y @@ -34,6 +38,10 @@ quiz: - $2y$10$FquR69q7W4E68TX/SNCB7u8Ri0DOFRDqsUPdGfuyIBjZJRVFkNI.6 - $2y$10$FSWRA7hulVpyVxd8s67Nxuq/1cdmviW24qqoUbqihBf79cR.w9yly - $2y$10$Qy1IsNsfuJvA384ypL/72uWubUuNbMRp4LD6j/LM0RIH66D/HIjF6 + evanphilakhong: + - $2y$10$3ERfjtWq6bYipHm0QGOuDe8oeXth3dnmfxT8g5P65sc8m4EivQNY. + - $2y$10$cr3WSpMx9zljgMYCqz4uYOAMT2iOzDaRsnoQi6CfPu/761F.1EpwW + - $2y$10$us8POdRzHVBFr1wNcuC7iuDg/YsQvr0GXe5JpFg8EIWzc6IMnIEUG jeremiahwing: - $2y$10$YLN9gvb8/fBf3ByHNIdb9.UZ8ilcuCdPgZN9QIYd2rwD23vzt2lvy - $2y$10$AEUmg5pH8c2VLZ871//G4eKjwx5cnKH5c2HGTNXdnAPF.3/ZmNap2 @@ -42,4 +50,8 @@ quiz: jasonwatson: - $2y$10$AZtPKyQ.6Bzb.jreO/u.2O3C7XfvYAVpjHzLkuhLVdsX74wc4vXwS - $2y$10$QbKtEXqpeItigRLAHsn8Qe/06ZpXhKEP1bGPJSFXymsoFw9.04NHy - - $2y$10$tJLScW1OZpOLpVllM65EI.W1QjkSIIBtz.KG8z/s.07RNb7ZWC0um \ No newline at end of file + - $2y$10$tJLScW1OZpOLpVllM65EI.W1QjkSIIBtz.KG8z/s.07RNb7ZWC0um + chanelhutt: + - $2y$10$7/GS4n5j/5TXQc5zjDzlc.2xBKwRqrsksWzcl7VKRwa.fDxzdficS + - $2y$10$9mfdal67CXoVG2phPKe1s.BpAT6HQeyQIiDtStfFazkPMW2AaW6Zu + - $2y$10$LiCnvad23bwZWZbxXLhs3.r/YdwIX9eAFtjofaW1AH3Htnc9sEU1G diff --git a/lesson_03/quiz/src/quizzes/Chanel_Huttquiz.ts b/lesson_03/quiz/src/quizzes/Chanel_Huttquiz.ts new file mode 100644 index 000000000..49afd890c --- /dev/null +++ b/lesson_03/quiz/src/quizzes/Chanel_Huttquiz.ts @@ -0,0 +1,68 @@ +import { + AnswerChoice, + MultipleChoiceQuizQuestion, + QuizQuestion, + QuizQuestionProvider, +} from 'codedifferently-instructional'; + +export class ChanelHuttQuiz implements QuizQuestionProvider { + getProviderName(): string { + return 'chanelhutt'; + } + + makeQuizQuestions(): QuizQuestion[] { + return [ + ChanelHuttQuiz.makeQuestion0(), + ChanelHuttQuiz.makeQuestion1(), + ChanelHuttQuiz.makeQuestion2(), + ]; + } + + private static makeQuestion0(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 0, + 'Which one is not a purpose for git commit?', + new Map([ + [AnswerChoice.A, 'To save changes to your local repository'], + [ + AnswerChoice.B, + 'To provide a clear, descriptive message for the changes made', + ], + [AnswerChoice.C, 'To clear the terminal and re-type the command'], + [AnswerChoice.D, 'Keeps track of changes made to your code'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + + private static makeQuestion1(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 1, + 'Which answer best fits the command git push?', + new Map([ + [AnswerChoice.A, 'To move the code to the trash'], + [ + AnswerChoice.B, + 'To transfer files from the local repository to remote repository hosting services', + ], + [AnswerChoice.C, 'To add comments to the code'], + [AnswerChoice.D, 'To merge several branches into one branch'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + + private static makeQuestion2(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 2, + 'Which command is used to update the yourlocal repository with changes from your remote repository?', + new Map([ + [AnswerChoice.A, 'git fetch upstream'], + [AnswerChoice.B, 'git pull'], + [AnswerChoice.C, 'git commit'], + [AnswerChoice.D, 'git checkout main'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } +} diff --git a/lesson_03/quiz/src/quizzes/dylan_lafferty_quiz.ts b/lesson_03/quiz/src/quizzes/dylan_lafferty_quiz.ts new file mode 100644 index 000000000..e56cad9c4 --- /dev/null +++ b/lesson_03/quiz/src/quizzes/dylan_lafferty_quiz.ts @@ -0,0 +1,61 @@ +import { + AnswerChoice, + MultipleChoiceQuizQuestion, + QuizQuestion, + QuizQuestionProvider, +} from 'codedifferently-instructional'; + +export class DylanLaffertyQuiz implements QuizQuestionProvider { + getProviderName(): string { + return 'dylanlafferty'; + } + + makeQuizQuestions(): QuizQuestion[] { + return [ + DylanLaffertyQuiz.makeQuestion0(), + DylanLaffertyQuiz.makeQuestion1(), + DylanLaffertyQuiz.makeQuestion2(), + ]; + } + + private static makeQuestion0(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 0, + 'What is the Power supply unit most compared to when comparing it to a human body?', + new Map([ + [AnswerChoice.A, 'Heart'], + [AnswerChoice.B, 'Arm'], + [AnswerChoice.C, 'Leg'], + [AnswerChoice.D, 'Brain'], + ]), + AnswerChoice.UNANSWERED, + ); + } + private static makeQuestion1(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 1, + 'What is the full name of CPU?', + new Map([ + [AnswerChoice.A, 'Central Place Unit'], + [AnswerChoice.B, 'Certified Processing Unit'], + [AnswerChoice.C, 'Central Processing Unit'], + [AnswerChoice.D, 'Configured Procerdale Unicode'], + ]), + AnswerChoice.UNANSWERED, + ); + } + + private static makeQuestion2(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 2, + 'What is used to keep Short term memory in a computer?', + new Map([ + [AnswerChoice.A, 'Hard Drive'], + [AnswerChoice.B, 'SSD'], + [AnswerChoice.C, 'GPU'], + [AnswerChoice.D, 'RAM'], + ]), + AnswerChoice.UNANSWERED, + ); + } +} diff --git a/lesson_03/quiz/src/quizzes/evan_philakhong_quiz.ts b/lesson_03/quiz/src/quizzes/evan_philakhong_quiz.ts new file mode 100644 index 000000000..564888dc5 --- /dev/null +++ b/lesson_03/quiz/src/quizzes/evan_philakhong_quiz.ts @@ -0,0 +1,62 @@ +import { + AnswerChoice, + MultipleChoiceQuizQuestion, + QuizQuestion, + QuizQuestionProvider, +} from 'codedifferently-instructional'; + +export class EvanPhilakhongQuiz implements QuizQuestionProvider { + getProviderName(): string { + return 'evanphilakhong'; + } + + makeQuizQuestions(): QuizQuestion[] { + return [ + EvanPhilakhongQuiz.makeQuestion0(), + EvanPhilakhongQuiz.makeQuestion1(), + EvanPhilakhongQuiz.makeQuestion2(), + ]; + } + + private static makeQuestion0(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 0, + 'What is a CPU?', + new Map([ + [AnswerChoice.A, 'Computer Power Unit'], + [AnswerChoice.B, 'Complex Processing Unit'], + [AnswerChoice.C, 'Central Processing Unit'], + [AnswerChoice.D, 'Coding Processor Unit'], + ]), + AnswerChoice.UNANSWERED, // replace UNANSWERED with correct answer + ); + } + + private static makeQuestion1(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 1, + 'What is a GPU?', + new Map([ + [AnswerChoice.A, 'Graphics Processing Unit'], + [AnswerChoice.B, 'Gaming Power Unit'], + [AnswerChoice.C, 'Graphical Programming Unit'], + [AnswerChoice.D, 'Gaming Processor Unit'], + ]), + AnswerChoice.UNANSWERED, // replace UNANSWERED with correct answer + ); + } + + private static makeQuestion2(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 2, + 'What is a PSU?', + new Map([ + [AnswerChoice.A, 'Programming Super Unit'], + [AnswerChoice.B, 'Power Supply Unit'], + [AnswerChoice.C, 'Power Supplier Unit'], + [AnswerChoice.D, 'Power Storing Unit'], + ]), + AnswerChoice.UNANSWERED, // repleace UNANSWERED with correct answer + ); + } +} diff --git a/lesson_03/quiz/src/quizzes/quizzes.module.ts b/lesson_03/quiz/src/quizzes/quizzes.module.ts index 91f49d297..91f00eace 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -1,15 +1,18 @@ import { Module } from '@nestjs/common'; import { AnotherQuiz } from './another_quiz.js'; import { AnthonyMaysQuiz } from './anthony_mays_quiz.js'; -import { JasonWatsonQuiz } from './jason_watson_quiz.js'; -import { MeikoStephensQuiz } from './meiko_stephens_quiz.js'; +import { DylanLaffertyQuiz } from './dylan_lafferty_quiz.js'; +import { ChanelHuttQuiz } from './Chanel_Huttquiz.js'; import { DavidAdenaikeQuiz } from './david_adenaike_quiz.js'; +import { EvanPhilakhongQuiz } from './evan_philakhong_quiz.js'; import { EzraQuiz } from './ezra_quiz.js'; +import { JasonWatsonQuiz } from './jason_watson_quiz.js'; import { Jbeyquiz } from './jbeyquiz.js'; +import { JeremiahWingQuiz } from './jeremiah_wing_quiz.js'; import { KhaylaSaundersQuiz } from './khayla_quiz.js'; +import { MeikoStephensQuiz } from './meiko_stephens_quiz.js'; import { MercedesMathewsQuiz } from './mercedes_mathews_quiz.js'; import { RasheedMillerQuiz } from './rasheed_miller_quiz.js'; -import { JeremiahWingQuiz } from './jeremiah_wing_quiz.js'; export const Quizzes = Symbol.for('Quizzes'); @@ -23,8 +26,11 @@ const QUIZ_PROVIDERS = [ Jbeyquiz, EzraQuiz, DavidAdenaikeQuiz, + EvanPhilakhongQuiz, KhaylaSaundersQuiz, + DylanLaffertyQuiz, RasheedMillerQuiz, + ChanelHuttQuiz, JeremiahWingQuiz, JasonWatsonQuiz, ]; diff --git a/lesson_04/anthonydmays/README.md b/lesson_04/anthonydmays/README.md index 0e0a3b4b2..b14a9909f 100644 --- a/lesson_04/anthonydmays/README.md +++ b/lesson_04/anthonydmays/README.md @@ -37,4 +37,4 @@ The JavaScript implementation uses a function named `isEven` that also takes a s - JavaScript has type coercion, which can sometimes lead to unexpected results if the input is not properly handled. In contrast, Python is more strict with types. 3. **Function Calls**: - - The syntax for calling functions and printing to the console/output is slightly different. Python uses `print()`, while JavaScript uses `console.log()`. + - The syntax for calling functions and printing to the console/output is slightly different. Python uses `print()`, while JavaScript uses `console.log()`.# \ No newline at end of file diff --git a/lesson_04/dylanlafferty/ReadME.md b/lesson_04/dylanlafferty/ReadME.md new file mode 100644 index 000000000..126dda33d --- /dev/null +++ b/lesson_04/dylanlafferty/ReadME.md @@ -0,0 +1,81 @@ +## Java Implementation + +```class PrimeChecker { + public static boolean isPrime(int number) { + if (number <= 1) { + return false; + } + + // Check if number is divisible by any number from 2 to sqrt(number) + for (int i = 2; i <= Math.sqrt(number); i++) { + if (number % i == 0) { + return false; + } + } + return true; + } + + public static void main(String[] args) { + int num1 = 11; //This number may be changed to change the input + int num2 = 15; //This one too + System.out.println(num1 + " is prime: " + isPrime(num1)); + System.out.println(num2 + " is prime: " + isPrime(num2)); + } +} +``` + +## JavaScript implementation + +``` +// let number = prompt("Enter a number to check if it is a Prime number"); + +function checkPrime(number) { + if (number === null || number === undefined) { + console.log("You have not entered a number"); + return; + } + + if (number <= 1) { + console.log("This is not a prime number"); + return false; // Numbers less than or equal to 1 are not prime + } + + for (let i = 2; i < Math.sqrt(number); i++) { + if (number % i === 0) { + console.log("This is not a prime number"); + return false; // If divisible by any number other than 1 and itself + } + } + + console.log("This is a prime number"); + return true; // If no divisors were found, the number is prime +} + +console.log(checkPrime(45)); // +console.log(checkPrime(23)); // +console.log(checkPrime(13)); // +``` + +## Explaination + +The Java +The Java implementation uses a class named `PrimeChecker`. `PrimeChecker` will get an integer named `number` and run it through 2 tests. The first test will be to see if `number` is less than or greater than 1 which then will return `false`. It will then see if the number is able to be divided by anything other than itself and if not then it will return `True`. + +The JavaScript implementation uses a function named `checkPrime`. `CheckPrime` first checks if a `number` has been entered. If a `number` has been entered and if it is less than or equal to 1 it will return `True`. If this passes the for loop will run and see if that `number` can be divided into itself and if it can then return `False`. + +## Similarites +1. **Syntax** + - Both languages write If statements in the same way using `if(instance) { code } `. + - The For Loop are both written using `for` and adding the statements inside of `(statement1)`. + - Math works the same in both languages using the `%` for division. +2. **Input Fields** + - Both Languages can have a predefined input inside of the code. + - Both Languages can return either `true` or `false` to the console. + +## Differences +1. **Syntax** + - In `Java` there are two Static functions but one it required to be defined as main. However in `JavaScript` you do not need to define a main function. + - In `Java` in order to print something you have to write a `system.out.print` compared to `JavaScript` It uses the `console.log`. +2. ## Declarations + - With `Java` You have to let the computer know what type of input you are giving it. So if you would want to give a variable a number you need to declare that as an integer or `int`. While you can just write a number out in `javaScript`. + \ No newline at end of file