Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lesson_03/quiz/quiz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ quiz:
- $2y$10$dkWnar/ZXMr9ndtRDcbTbe/HN3DhuULPoZhTx/xATi.UYQ0DUIx1W
- $2y$10$.Cw9Sjf6Pf9K8EsThegQ5e8BMoJdLl40CCuJ2FKHLar1k8hVfR9fu
- $2y$10$.pmOuTs0Oqjfhn9mMIQCQu7Fbe1ZOZmZIbTGqqul.hnVLqIV6bn/W
hummadtanweer:
- $2y$10$r.JmLYmaAWLZPwv6LLFWB.W823BWj7CsDaPdi5hxv4ExQyCjDq.l.
- $2y$10$DcSjwFSOP.120fEp1zJgEe9J3qZiWPa0i/ofYQS6p3sG93jwCi3ci
- $2y$10$O0Xy3FSVwWM3Tqeh3dP.tuv6E3OHN10siHbgJ4.iPIaZLJ1kVheC6
pablolimonparedes:
- $2y$10$Oj.VjaxLuCk3H3XGRLH99.y5LnVkVqEAS30eopxFsNfL6FQ0RRdbC
- $2y$10$cs9lhS.nLe6Ym1nkgvr89Oa6Se5DafERs6MJm0t6plQ76zGlTj9JC
- $2y$10$ftCSIQi1kpbWf9CYsrmjCe1H/i/NWzqTX3Jfuqi0TAPcqoCdxrk3O
- $2y$10$ftCSIQi1kpbWf9CYsrmjCe1H/i/NWzqTX3Jfuqi0TAPcqoCdxrk3O
62 changes: 62 additions & 0 deletions lesson_03/quiz/src/quizzes/hummad_tanweer_quiz.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import {
AnswerChoice,
MultipleChoiceQuizQuestion,
QuizQuestion,
QuizQuestionProvider,
} from 'codedifferently-instructional';

export class HummadTanweerQuiz implements QuizQuestionProvider {
getProviderName(): string {
return 'hummadtanweer';
}

makeQuizQuestions(): QuizQuestion[] {
return [
HummadTanweerQuiz.makeQuestion0(),
HummadTanweerQuiz.makeQuestion1(),
HummadTanweerQuiz.makeQuestion2(),
];
}

private static makeQuestion0(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
0,
'Who is attributed with inventing GIT?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'Linus Torvalds'],
[AnswerChoice.B, 'James Gosling'],
[AnswerChoice.C, 'Koska Kawaguchi'],
[AnswerChoice.D, 'Junio C. Hamano'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion1(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
1,
'What is the opposite of a GIT clone?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'GIT add'],
[AnswerChoice.B, 'GIT push'],
[AnswerChoice.C, 'GIT upload'],
[AnswerChoice.D, 'GIT status'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}

private static makeQuestion2(): QuizQuestion {
return new MultipleChoiceQuizQuestion(
2,
'How do you check the state of your local git repository since your last commit?',
new Map<AnswerChoice, string>([
[AnswerChoice.A, 'GIT diff'],
[AnswerChoice.B, 'GIT commit'],
[AnswerChoice.C, 'GIT status'],
[AnswerChoice.D, 'GIT check'],
]),
AnswerChoice.UNANSWERED,
); // Replace `UNANSWERED` with the correct answer.
}
}
2 changes: 2 additions & 0 deletions lesson_03/quiz/src/quizzes/quizzes.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { AnthonyMaysQuiz } from './anthony_mays_quiz.js';
import { ChelseaOgbonniaQuiz } from './chelsea_ogbonnia_quiz.js';
import { ChigazoGrahamsQuiz } from './chigazo_graham_quiz.js';
import { DasiaEnglishQuiz } from './dasia_english_quiz.js';
import { HummadTanweerQuiz } from './hummad_tanweer_quiz.js';
import { JamesCapparellQuiz } from './james_capparell_quiz.js';
import { JosephCaballeroQuiz } from './joseph_caballero_quiz.js';
import { KimberleeHaldaneQuiz } from './kimberlee_haldane_quiz.js';
Expand Down Expand Up @@ -39,6 +40,7 @@ const QUIZ_PROVIDERS = [
ZionBuchananQuiz,
ChelseaOgbonniaQuiz,
TommyTranQuiz,
HummadTanweerQuiz,
PabloLimonParedesQuiz,
];

Expand Down
2 changes: 1 addition & 1 deletion lesson_04/anthonydmays/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The JavaScript implementation uses a function named `isEven` that also takes a s

1. **Syntax**:
- In Python, functions are defined using the `def` keyword, whereas in JavaScript, the `function` keyword is used.
- Python uses `True` and `False` for boolean values, while JavaScript uses `true` and `false`.
- Java uses `True` and `False` for boolean values, while JavaScript uses `true` and `false`.

2. **Type Coercion**:
- 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.
Expand Down
57 changes: 57 additions & 0 deletions lesson_04/hummadtanweer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@


```Java
static boolean checkPrime(int num) {
boolean prime = false;
if (num == 0 || num == 1) {
prime = true;
}
for (int i = 2; i <= num / 2; i++) {
if (num % i == 0) {
prime = true;
break;
}
}
return !prime;
}

# Example usage:
print(checkPrime(4)) # Output: false
print(checkPrime(7)) # Output: true

## JavaScript implementation

```javascript
function checkPrime(num) {
let prime = false;
if (num === 0 || num === 1) {
prime = true;
}
for (let i = 2; i <= num / 2; i++) {
if (num % i === 0) {
prime = true;
break;
}
}
return !prime;
}
// Example usage:
console.log(checkPrime(4)); // Output: false
console.log(checkPrime(7)); // Output: true


## Explanation

The Javascript implementation uses a function named `checkPrime` that takes a single argument `number`. It returns `True` if the number is prime, otherwise, it returns `False`.

The Java implementation uses a function named `checkPrime` that also takes a single argument `int number`. It returns `true` if the number is Prime and `false` otherwise.

Java uses `true` and `talse` for boolean values and JavaScript uses `true` and `false`.

### Differences

**Function Calls**:
- The syntax for calling functions and printing to the console/output is slightly different. Java uses `print()`, while JavaScript uses `console.log()`.

**Citation
https://www.programiz.com/java-programming/online-compiler/?ref=8039b165