From 7f067c8d2145ad195c298d2ef0eeed678308a936 Mon Sep 17 00:00:00 2001 From: TatsuyaRyujin <112430696+TatsuyaRyujin@users.noreply.github.com> Date: Wed, 12 Mar 2025 16:25:52 -0400 Subject: [PATCH 1/7] feat: adds Evan's custom quiz (#124) * feat: added Encoded Answers * fix: encryption * test: Encryption * fix: Encoding * fix: wrong # of quzzes * fix: encryption * fix: Encoding * test: Multiple Coice Questions Configured incorrectly * fix: duplicate quiz provider * fix: changed answer choice to UNANSWERED --------- Co-authored-by: Anthony D. Mays --- lesson_03/quiz/quiz.yaml | 4 ++ .../quiz/src/quizzes/evan_philakhong_quiz.ts | 62 +++++++++++++++++++ lesson_03/quiz/src/quizzes/quizzes.module.ts | 2 + 3 files changed, 68 insertions(+) create mode 100644 lesson_03/quiz/src/quizzes/evan_philakhong_quiz.ts diff --git a/lesson_03/quiz/quiz.yaml b/lesson_03/quiz/quiz.yaml index eb7a5e60c..d61da8187 100644 --- a/lesson_03/quiz/quiz.yaml +++ b/lesson_03/quiz/quiz.yaml @@ -34,6 +34,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 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..4ec59abb8 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -4,6 +4,7 @@ import { AnthonyMaysQuiz } from './anthony_mays_quiz.js'; import { JasonWatsonQuiz } from './jason_watson_quiz.js'; import { MeikoStephensQuiz } from './meiko_stephens_quiz.js'; import { DavidAdenaikeQuiz } from './david_adenaike_quiz.js'; +import { EvanPhilakhongQuiz } from './evan_philakhong_quiz.js'; import { EzraQuiz } from './ezra_quiz.js'; import { Jbeyquiz } from './jbeyquiz.js'; import { KhaylaSaundersQuiz } from './khayla_quiz.js'; @@ -23,6 +24,7 @@ const QUIZ_PROVIDERS = [ Jbeyquiz, EzraQuiz, DavidAdenaikeQuiz, + EvanPhilakhongQuiz, KhaylaSaundersQuiz, RasheedMillerQuiz, JeremiahWingQuiz, From a236d7d518595893be549b584b9a0adf327ef689 Mon Sep 17 00:00:00 2001 From: NelltheWiz Date: Wed, 12 Mar 2025 16:45:19 -0400 Subject: [PATCH 2/7] chore: adds Chanel's custom quiz (#137) --- lesson_03/quiz/quiz.yaml | 6 +- lesson_03/quiz/src/quizzes/Chanel_Huttquiz.ts | 68 +++++++++++++++++++ lesson_03/quiz/src/quizzes/quizzes.module.ts | 8 ++- 3 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 lesson_03/quiz/src/quizzes/Chanel_Huttquiz.ts diff --git a/lesson_03/quiz/quiz.yaml b/lesson_03/quiz/quiz.yaml index d61da8187..a983f6426 100644 --- a/lesson_03/quiz/quiz.yaml +++ b/lesson_03/quiz/quiz.yaml @@ -46,4 +46,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/quizzes.module.ts b/lesson_03/quiz/src/quizzes/quizzes.module.ts index 4ec59abb8..f768b1cef 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -1,16 +1,17 @@ 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 { 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'); @@ -27,6 +28,7 @@ const QUIZ_PROVIDERS = [ EvanPhilakhongQuiz, KhaylaSaundersQuiz, RasheedMillerQuiz, + ChanelHuttQuiz, JeremiahWingQuiz, JasonWatsonQuiz, ]; From 4bb35ecf6ed5906cbd8373776854aee108b3c314 Mon Sep 17 00:00:00 2001 From: Dlafferty251 Date: Wed, 12 Mar 2025 16:52:26 -0400 Subject: [PATCH 3/7] feat: adds Dylan's custom quiz (#135) * I have created a new branch adding in Homework 3 because of a merge bug on my last branch * David Adenaike Quiz (#119) Co-authored-by: Dadenaike251 Co-authored-by: Vicente Vigueras <161079929+VicenteVigueras@users.noreply.github.com> * I have created a new branch adding in Homework 3 because of a merge bug on my last branch * Changing answers to unanswered * gettting rid of khaylas and meikos lesson 1 files * Add jasons quiz * Revert to the Commit "Add jasons quiz" This reverts commit 8f83a1ffd4e9215837cf281cf1596e0f6c5e32d4. * Revert to the Commit "Add jasons quiz"" This reverts commit b744dfef294537362e2e76e4e135c4f0c360b550. * Reverting to "gettting rid of khaylas and meikos lesson 1 files" This reverts commit b4e2b42b1c4532b5db9f82acee9c2a9a3ad902d7. * Getting rid of lesson 04's work from Lesson 03's branch * Chore: getting my file to be readded to my repo and also have added Jerimiahs quiz --------- Co-authored-by: Dadenaike251 Co-authored-by: Dadenaike251 Co-authored-by: Vicente Vigueras <161079929+VicenteVigueras@users.noreply.github.com> --- lesson_03/quiz/quiz.yaml | 4 ++ .../quiz/src/quizzes/dylan_lafferty_quiz.ts | 61 +++++++++++++++++++ lesson_03/quiz/src/quizzes/quizzes.module.ts | 2 + 3 files changed, 67 insertions(+) create mode 100644 lesson_03/quiz/src/quizzes/dylan_lafferty_quiz.ts diff --git a/lesson_03/quiz/quiz.yaml b/lesson_03/quiz/quiz.yaml index a983f6426..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 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/quizzes.module.ts b/lesson_03/quiz/src/quizzes/quizzes.module.ts index f768b1cef..91f00eace 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -1,6 +1,7 @@ import { Module } from '@nestjs/common'; import { AnotherQuiz } from './another_quiz.js'; import { AnthonyMaysQuiz } from './anthony_mays_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'; @@ -27,6 +28,7 @@ const QUIZ_PROVIDERS = [ DavidAdenaikeQuiz, EvanPhilakhongQuiz, KhaylaSaundersQuiz, + DylanLaffertyQuiz, RasheedMillerQuiz, ChanelHuttQuiz, JeremiahWingQuiz, From 83a0079c26a366cd0375f776dc0cad814d644069 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 13 Mar 2025 13:32:28 +0000 Subject: [PATCH 4/7] Feat: Added Java and JavaScript Functions to find a prime number with explanations on how it works and hows its different. --- lesson_04/dylanlafferty/Person.java | 21 +++++++ lesson_04/dylanlafferty/ReadME.md | 81 +++++++++++++++++++++++++++ lesson_04/dylanlafferty/javaScript.js | 29 ++++++++++ 3 files changed, 131 insertions(+) create mode 100644 lesson_04/dylanlafferty/Person.java create mode 100644 lesson_04/dylanlafferty/ReadME.md create mode 100644 lesson_04/dylanlafferty/javaScript.js diff --git a/lesson_04/dylanlafferty/Person.java b/lesson_04/dylanlafferty/Person.java new file mode 100644 index 000000000..3bdc98836 --- /dev/null +++ b/lesson_04/dylanlafferty/Person.java @@ -0,0 +1,21 @@ +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; + int num2 = 15; + System.out.println(num1 + " is prime: " + isPrime(num1)); + System.out.println(num2 + " is prime: " + isPrime(num2)); + } +} \ 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..c7a682a64 --- /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 diff --git a/lesson_04/dylanlafferty/javaScript.js b/lesson_04/dylanlafferty/javaScript.js new file mode 100644 index 000000000..5dbbb5489 --- /dev/null +++ b/lesson_04/dylanlafferty/javaScript.js @@ -0,0 +1,29 @@ + +// 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 false; + } + + 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 +} + +//you can change the number inside of the checkPrime function to test different numbers +console.log(checkPrime(45)); // +console.log(checkPrime(23)); // +console.log(checkPrime(13)); // \ No newline at end of file From 6f19887773bf43aa9bba609b62fe6c8b5b8a1200 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 13 Mar 2025 13:32:52 +0000 Subject: [PATCH 5/7] Chore: Fixing Grammar issues. --- lesson_04/anthonydmays/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 60eac211d9645fd7cdc90934bd596f96c9fae36e Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 13 Mar 2025 13:44:46 +0000 Subject: [PATCH 6/7] Getting rid of my Java and Java script test files --- lesson_04/dylanlafferty/Person.java | 21 ------------------- lesson_04/dylanlafferty/javaScript.js | 29 --------------------------- 2 files changed, 50 deletions(-) delete mode 100644 lesson_04/dylanlafferty/Person.java delete mode 100644 lesson_04/dylanlafferty/javaScript.js diff --git a/lesson_04/dylanlafferty/Person.java b/lesson_04/dylanlafferty/Person.java deleted file mode 100644 index 3bdc98836..000000000 --- a/lesson_04/dylanlafferty/Person.java +++ /dev/null @@ -1,21 +0,0 @@ -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; - int num2 = 15; - System.out.println(num1 + " is prime: " + isPrime(num1)); - System.out.println(num2 + " is prime: " + isPrime(num2)); - } -} \ No newline at end of file diff --git a/lesson_04/dylanlafferty/javaScript.js b/lesson_04/dylanlafferty/javaScript.js deleted file mode 100644 index 5dbbb5489..000000000 --- a/lesson_04/dylanlafferty/javaScript.js +++ /dev/null @@ -1,29 +0,0 @@ - -// 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 false; - } - - 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 -} - -//you can change the number inside of the checkPrime function to test different numbers -console.log(checkPrime(45)); // -console.log(checkPrime(23)); // -console.log(checkPrime(13)); // \ No newline at end of file From 11f980a61077191b6fd3d895d025b4206eacf0d2 Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 14 Mar 2025 16:35:25 +0000 Subject: [PATCH 7/7] Chore: Grammar Fixes --- lesson_04/dylanlafferty/ReadME.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lesson_04/dylanlafferty/ReadME.md b/lesson_04/dylanlafferty/ReadME.md index c7a682a64..126dda33d 100644 --- a/lesson_04/dylanlafferty/ReadME.md +++ b/lesson_04/dylanlafferty/ReadME.md @@ -24,7 +24,7 @@ } ``` -##JavaScript implementation +## JavaScript implementation ``` // let number = prompt("Enter a number to check if it is a Prime number");