Skip to content

Robel H. - #16

Open
robzi18 wants to merge 1 commit into
HackYourAssignment:mainfrom
robzi18:main
Open

robzi18 wants to merge 1 commit into
HackYourAssignment:mainfrom
robzi18:main

Conversation

@robzi18

@robzi18 robzi18 commented Nov 12, 2026

Copy link
Copy Markdown
  • All the required tasks from the assignment are done.

@Naraujo13 Naraujo13 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey!

Great job on the Week 2 assignment! 🎉

It is great to see all three tasks running smoothly plus the creative touches like the loop in Task 1 and the UI lock in Task 2.

A side note: committing package-lock.json is totally fine and actually good practice in Node projects!

There are a couple of small logic fixes needed for Task 2.
Take a look at the inline comments and push an update when you're ready.

Feel free to reach out on Slack if anything is unclear!

Cheers

Comment thread task-1/leap-year.js
function is_valid_year(y) {
return Number.isInteger(y) && y >= 1 && y <= 9999;
}
while (user_option) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice script!

I like usage of the loop to allow testing of multiple values

Comment thread task-1/leap-year.js
while (user_option) {
var year = prompt("Enter a year:");
year = Number(year);
console.log(`year is ${year}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus: adding logs like this is common and helps a lot during development, but a good practice is to remove them at the end

Comment thread task-2/login.js
} else {
errorMessage("Incorrect credentials.");
}
incorrectAttempts++;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: This is outside the login conditionals. What happens if someone enters the correct credentials 4 times in a row?

Comment thread task-3/converter.js
} else if (menuSelection === "3") {
console.log(`The current exchange rate is 1 Eur = ${EUR_USD_RATE} USD.`);
} else {
console.log("Invalid selection. Please choose either 1 or 2.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus: We have three options now that you implemented the exchange rate display

Comment thread task-2/login.js
Comment on lines +28 to +31
if (incorrectAttempts >= 4) {
errorMessage("Login blocked: Too many incorrect attempts");
lockWindow(5); // Lock the window for 5 seconds on 4th incorrect attempt
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: This is never executed, the incorrectAttempts variable is always reset beforehand. Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants