Skip to content

Conversation

@homsi6313-art
Copy link

No description provided.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link

📝 HackYourFuture auto grade

Assignment Score: 0 / 100 ✅

Status: ✅ Passed
Minimum score to pass: 0
🧪 The auto grade is experimental and still being improved

Test Details

@remarcmij remarcmij self-assigned this Jan 28, 2026
Copy link

@remarcmij remarcmij left a comment

Choose a reason for hiding this comment

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

Hi @homsi6313-art, thanks for submitting your assignment. I have some minor comments but will approve your PR now,

const cleanTitle = isBookTitle.toLowerCase();

return cleanTitle.includes(cleanSearchString);
}

Choose a reason for hiding this comment

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

Correct, but it would be easier to check if you included the code to run the tests.

Suggested change
}
}
console.log(isBookApplicable('javascript'));
// Output: true
console.log(isBookApplicable('javascript '));
// Output: true
console.log(isBookApplicable('python'));
// Output: false
console.log(isBookApplicable('JavaScript'));
// Output: true
console.log(isBookApplicable('JAVASCRIPT'));
// Output: true

function parseDateString(dateString) {
const trimmed = dateString.trim();

const parts = trimmed.split(/\s+/);

Choose a reason for hiding this comment

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

This regular expression matches one or more whitespace characters (spaces, tabs). If this is how you understand it too, then this is an excellent choice. However, I would have accepted a space constant as a separator too here.

Suggested change
const parts = trimmed.split(/\s+/);
const parts = trimmed.split(' ');

return { day, month, year,};
}

const day = Number(first);

Choose a reason for hiding this comment

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

You are assuming here that if it is not MDY, it must be DMY. That happens to be the case in the example console.logs. Maybe you could return an error message when it is not DMY so that it prints with the console.log?

export function convertHoursToMinutes(hours) {
return hours * 60;
}
export function convertMinutesToHours(minutes) {

Choose a reason for hiding this comment

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

It is a best practice to separate function definitions with a blank line, for readability purposes.

return "Hot";
}

function printWeatherReport(city, tempCelsius) {

Choose a reason for hiding this comment

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

Why are the function definitions from printWeatherReport() and calculateWindChill() indented like this?

Comment on lines 41 to 49
printWeatherReport("Amsterdam", 22);

// Wind chill calculation for City 1
let windSpeed1 = 15;
let windChill1 = 13.12 + 0.6215 * tempCelsius1 - 11.37 * Math.pow(windSpeed1, 0.16) + 0.3965 * tempCelsius1 * Math.pow(windSpeed1, 0.16);
console.log("Wind chill in " + cityName1 + ": " + windChill1.toFixed(2) + "°C");
printWeatherReport("berlin", 15);

// Wind chill calculation for City 2
let windSpeed2 = 20;
let windChill2 = 13.12 + 0.6215 * tempCelsius2 - 11.37 * Math.pow(windSpeed2, 0.16) + 0.3965 * tempCelsius2 * Math.pow(windSpeed2, 0.16);
console.log("Wind chill in " + cityName2 + ": " + windChill2.toFixed(2) + "°C");
printWeatherReport("Copenhagen", 5);

// Wind chill calculation for City 3
let windSpeed3 = 25;
let windChill3 = 13.12 + 0.6215 * tempCelsius3 - 11.37 * Math.pow(windSpeed3, 0.16) + 0.3965 * tempCelsius3 * Math.pow(windSpeed3, 0.16);
console.log("Wind chill in " + cityName3 + ": " + windChill3.toFixed(2) + "°C"); No newline at end of file
printWindChill("Amsterdam", 22, 15);
printWindChill("Berlin", 15, 20);
printWindChill("Copenhagen", 5, 25); No newline at end of file

Choose a reason for hiding this comment

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

Your code could be made DRYer still:

Suggested change
printWeatherReport("Amsterdam", 22);
// Wind chill calculation for City 1
let windSpeed1 = 15;
let windChill1 = 13.12 + 0.6215 * tempCelsius1 - 11.37 * Math.pow(windSpeed1, 0.16) + 0.3965 * tempCelsius1 * Math.pow(windSpeed1, 0.16);
console.log("Wind chill in " + cityName1 + ": " + windChill1.toFixed(2) + "°C");
printWeatherReport("berlin", 15);
// Wind chill calculation for City 2
let windSpeed2 = 20;
let windChill2 = 13.12 + 0.6215 * tempCelsius2 - 11.37 * Math.pow(windSpeed2, 0.16) + 0.3965 * tempCelsius2 * Math.pow(windSpeed2, 0.16);
console.log("Wind chill in " + cityName2 + ": " + windChill2.toFixed(2) + "°C");
printWeatherReport("Copenhagen", 5);
// Wind chill calculation for City 3
let windSpeed3 = 25;
let windChill3 = 13.12 + 0.6215 * tempCelsius3 - 11.37 * Math.pow(windSpeed3, 0.16) + 0.3965 * tempCelsius3 * Math.pow(windSpeed3, 0.16);
console.log("Wind chill in " + cityName3 + ": " + windChill3.toFixed(2) + "°C");
\ No newline at end of file
printWindChill("Amsterdam", 22, 15);
printWindChill("Berlin", 15, 20);
printWindChill("Copenhagen", 5, 25);
function printCityReport(city, tempCelsius, windSpeed) {
printWeatherReport(city, tempCelsius);
printWindChill(city, tempCelsius, windSpeed);
}
printCityReport('Amsterdam', 22, 15);
printCityReport('Berlin', 15, 20);
printCityReport('Copenhagen', 5, 25);

@remarcmij remarcmij added the Reviewed This assignment has been reivewed by a mentor and a feedback has been provided label Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed This assignment has been reivewed by a mentor and a feedback has been provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants