diff --git a/lesson_03/quiz/quiz.yaml b/lesson_03/quiz/quiz.yaml index 9cd2b3594..c2e96603d 100644 --- a/lesson_03/quiz/quiz.yaml +++ b/lesson_03/quiz/quiz.yaml @@ -50,6 +50,10 @@ quiz: - $2y$10$FquR69q7W4E68TX/SNCB7u8Ri0DOFRDqsUPdGfuyIBjZJRVFkNI.6 - $2y$10$FSWRA7hulVpyVxd8s67Nxuq/1cdmviW24qqoUbqihBf79cR.w9yly - $2y$10$Qy1IsNsfuJvA384ypL/72uWubUuNbMRp4LD6j/LM0RIH66D/HIjF6 + niapack: + - $2y$10$AHKmPPaTlafHO3T5q..kAuAhAy4n8Kn.wcY7ZAeYgokCjitwyjqE2 + - $2y$10$Z0g.9UO7qwkwoeNe8byn3.MVNIiIKBxa6ztLVHzDz.m5Ao5ozGqh6 + - $2y$10$QjpqUnI.C5UPmDuMPU.Eyu7k.T/qF0oAZDl0.osqlaJW.NC7Lvfya davisdarius: - $2y$10$s9Dh1bJak9WjT3sziuq1KeloNnDCuhgjsT6HA.m/fxjJSrJMK0lOu - $2y$10$Q58g8gsWhL1Zhje9WoLHKuqF44I3NK16i..EQ2SYVAa.PEkowhgOK @@ -75,7 +79,7 @@ quiz: jasonwatson: - $2y$10$AZtPKyQ.6Bzb.jreO/u.2O3C7XfvYAVpjHzLkuhLVdsX74wc4vXwS - $2y$10$QbKtEXqpeItigRLAHsn8Qe/06ZpXhKEP1bGPJSFXymsoFw9.04NHy - - $2y$10$tJLScW1OZpOLpVllM65EI.W1QjkSIIBtz.KG8z/s.07RNb7ZWC0um + - $2y$10$tJLScW1OZpOLpVllM65EI.W1QjkSIIBtz.KG8z/s.07RNb7ZWC0um chanelhutt: - $2y$10$7/GS4n5j/5TXQc5zjDzlc.2xBKwRqrsksWzcl7VKRwa.fDxzdficS - $2y$10$9mfdal67CXoVG2phPKe1s.BpAT6HQeyQIiDtStfFazkPMW2AaW6Zu diff --git a/lesson_03/quiz/src/quizzes/montez_quiz.ts b/lesson_03/quiz/src/quizzes/montez_quiz.ts index dacd7eb8d..eb529bf98 100644 --- a/lesson_03/quiz/src/quizzes/montez_quiz.ts +++ b/lesson_03/quiz/src/quizzes/montez_quiz.ts @@ -35,11 +35,11 @@ export class MontezBradleyQuiz implements QuizQuestionProvider { private static makeQuestion1(): QuizQuestion { return new MultipleChoiceQuizQuestion( 1, - 'What command is used to save all changes and create a commit in Git?', + 'How would you commit your code', new Map([ - [AnswerChoice.A, 'git status'], + [AnswerChoice.A, 'git commit -m "" '], [AnswerChoice.B, 'git info'], - [AnswerChoice.C, 'git check-status'], + [AnswerChoice.C, 'git commit'], [AnswerChoice.D, 'git add git commit -m "Your commit message'], ]), AnswerChoice.UNANSWERED, @@ -49,15 +49,19 @@ export class MontezBradleyQuiz implements QuizQuestionProvider { private static makeQuestion2(): QuizQuestion { return new MultipleChoiceQuizQuestion( 2, - 'What Git command is used to check the current status of a repository', + 'How would you push your vs code main to replace your main branch in github ', new Map([ - [AnswerChoice.A, 'git status'], - [AnswerChoice.B, 'git verify'], - [AnswerChoice.C, 'git info'], - [AnswerChoice.D, 'git check-status'], + [ + AnswerChoice.A, + 'pull your commits to vs code, git reset --hard upstream/main, then git push --force', + ], + [AnswerChoice.B, 'git reset, then git push --force'], + [AnswerChoice.C, 'git info, then git pull, final step is git push'], + [AnswerChoice.D, 'git push after that git reset then git pull'], ]), AnswerChoice.UNANSWERED, - ); + ); } - } + +/* End of code */ diff --git a/lesson_03/quiz/src/quizzes/nia_quiz.ts b/lesson_03/quiz/src/quizzes/nia_quiz.ts new file mode 100644 index 000000000..542ef14ef --- /dev/null +++ b/lesson_03/quiz/src/quizzes/nia_quiz.ts @@ -0,0 +1,75 @@ +import { + AnswerChoice, + MultipleChoiceQuizQuestion, + QuizQuestion, + QuizQuestionProvider, +} from 'codedifferently-instructional'; + +export class NiaPackquiz implements QuizQuestionProvider { + getProviderName(): string { + return 'niapack'; + } + + makeQuizQuestions(): QuizQuestion[] { + return [ + NiaPackquiz.makeQuestion0(), + NiaPackquiz.makeQuestion1(), + NiaPackquiz.makeQuestion2(), + ]; + } + + private static makeQuestion0(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 0, + 'What is branching? Why is it important?', + new Map([ + [ + AnswerChoice.A, + 'It is when a tree grows and is important to make the sky look beautiful', + ], + [ + AnswerChoice.B, + 'It is when you create a seperate copy of a code and is important because it doesnt affect the main version and makes it easier to work with a team', + ], + [ + AnswerChoice.C, + 'It is when you delete all previous versions of your code and is important so you dont have to start from scratch', + ], + [ + AnswerChoice.D, + 'It is merging all changes directly into the main code and is important because it speeds up develpoment by avoiding unnecessary review or debugging steps', + ], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + private static makeQuestion1(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 1, + 'Which programming languages can you use in VS code?', + new Map([ + [AnswerChoice.A, 'Only Python'], + [AnswerChoice.B, 'Only JavaScript'], + [AnswerChoice.C, 'Multiple languages like Python, JavaScript, and C++'], + [AnswerChoice.D, 'C++'], + ]), + AnswerChoice.UNANSWERED, + ); // Replace `UNANSWERED` with the correct answer. + } + private static makeQuestion2(): QuizQuestion { + return new MultipleChoiceQuizQuestion( + 2, + 'What is a pull request request on GitHub?', + new Map([ + [ + AnswerChoice.A, + 'A way to merge changes from one branch into another after review', + ], + [AnswerChoice.B, 'A command to delete a branch permanently'], + [AnswerChoice.C, 'A method for creating a local copy of a repository'], + [AnswerChoice.D, 'A tool to schedule automatic repository backups'], + ]), + 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 87a4b319a..a07f74e9e 100644 --- a/lesson_03/quiz/src/quizzes/quizzes.module.ts +++ b/lesson_03/quiz/src/quizzes/quizzes.module.ts @@ -1,24 +1,25 @@ import { Module } from '@nestjs/common'; import { Bryanasingletonbarnhart } from './ bryana_singleton-barnhart_quiz.js'; +import { AnanatawaQuiz } from './ananatawa_quiz.js'; 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 { DavisDQuiz } from './davisd_quiz.js'; +import { DylanLaffertyQuiz } from './dylan_lafferty_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 { KarensQuiz } from './karen_alabi_quiz.js'; import { JeremiahWingQuiz } from './jeremiah_wing_quiz.js'; +import { KarensQuiz } from './karen_alabi_quiz.js'; import { KhaylaSaundersQuiz } from './khayla_quiz.js'; import { MeikoStephensQuiz } from './meiko_stephens_quiz.js'; import { MercedesMathewsQuiz } from './mercedes_mathews_quiz.js'; +import { MontezBradleyQuiz } from './montez_quiz.js'; +import { NiaPackquiz } from './nia_quiz.js'; import { OliviaJamesQuiz } from './olivia_james_quiz.js'; -import { MontezBradleyQuiz } from './montez_quiz.js'; import { RasheedMillerQuiz } from './rasheed_miller_quiz.js'; -import { AnanatawaQuiz } from './ananatawa_quiz.js'; export const Quizzes = Symbol.for('Quizzes'); @@ -39,6 +40,7 @@ const QUIZ_PROVIDERS = [ KhaylaSaundersQuiz, DylanLaffertyQuiz, RasheedMillerQuiz, + NiaPackquiz, DavisDQuiz, AnanatawaQuiz, OliviaJamesQuiz, @@ -58,3 +60,5 @@ const QUIZ_PROVIDERS = [ ], }) export class QuizzesModule {} + +/* End of code */ diff --git a/lesson_04/rasheedmiller/RM_README.md b/lesson_04/rasheedmiller/RM_README.md new file mode 100644 index 000000000..c2f954317 --- /dev/null +++ b/lesson_04/rasheedmiller/RM_README.md @@ -0,0 +1,80 @@ +## C# Implementation + +```c# +using System; + +class Program +{ + static bool IsPrime(int number) + { + if (number < 2) + return false; + + for (int i = 2; i <= Math.Sqrt(number); i++) + { + if (number % i == 0) + return false; + } + return true; + } + + static void Main() + { + Console.Write("Enter a number: "); + int num = int.Parse(Console.ReadLine()); + + if (IsPrime(num)) + Console.WriteLine($"{num} is a prime number."); + else + Console.WriteLine($"{num} is not a prime number."); + } +} +``` + +## C++ Implementation + +```c++ +#include +#include + +bool isPrime(int number) { + if (number < 2) + return false; + + for (int i = 2; i <= std::sqrt(number); i++) { + if (number % i == 0) + return false; + } + return true; +} + +int main() { + int num; + std::cout << "Enter a number: "; + std::cin >> num; + + if (isPrime(num)) + std::cout << num << " is a prime number." << std::endl; + else + std::cout << num << " is not a prime number." << std::endl; + + return 0; +} +``` + +## Explanation + +The C# "C Sharp" implementation uses a function named `Is_Prime`. This function takes a `number` as input and reads `true` if the number is Prime or `false` if the number is not Prime. + +The C++ "C Plus Plus" implementation uses a function named `is_Prime`. This function also takes a `number` as input and reads `true` if the number is Prime or `false` if the number is not Prime. + +# Similarities and Differences Index Chart + +| Feature | Similarities | Differences | +|-----------------------|-----------------------------------------------|-----------------------------------------------| +| **Syntax** | The names of the functions are similar. | C# uses "IsPrime". C++ uses "isPrime". | +| **Input** | Both take user input. | One coded in C# language. One coded C++ language.| +| **Main Function** | Both have main functions. | C# uses "static void Main()" C++ uses "int main()"| +| **First Line of Code** | Both have a line of code to start. | C# starts with "using System;". C++ starts with "#include "| +| **Printing Output** | Both use printing outputs. | C# uses "Console.WriteLine()". C++ uses "std::cout <<". | +