Skip to content

Hamed R.#10

Open
HamedRazizadeh-hub wants to merge 4 commits intoHackYourAssignment:mainfrom
HamedRazizadeh-hub:main
Open

Hamed R.#10
HamedRazizadeh-hub wants to merge 4 commits intoHackYourAssignment:mainfrom
HamedRazizadeh-hub:main

Conversation

@HamedRazizadeh-hub
Copy link

No description provided.

@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

Copy link

@rafaelhdr rafaelhdr left a comment

Choose a reason for hiding this comment

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

Task 1 and 2 were excellent. The task 3 and 4 could be improved.

@@ -0,0 +1,19 @@
const convertor = {

Choose a reason for hiding this comment

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

This code is good, and it is doing what is being asked. But it is not exported properly, and this is a library.

If you try to run the example, it fails (SyntaxError: Named export 'convertDaysToHours' not found.)

Try to fix it to make this a library.

console.log("Wind chill in " + cityName3 + ": " + windChill3.toFixed(2) + "°C"); No newline at end of file
const celsiusToFahrenheit = (celsius) => (celsius * 9) / 5 + 32;
const celsiusToKelvin = (celsius) => celsius + 273.15;
const getTemperatureStatus = (celsius) =>

Choose a reason for hiding this comment

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

This is a trap. Having so many ternaries chaining each other is really hard to read/maintain.

Ternary is really nice if you are doing just a single check (const a = b ? c : d). But if you have so many, try to use if else.

console.log(`Temperature: ${celsiusToFahrenheit(tempCelsius).toFixed(2)}°F`);
console.log(`Temperature: ${celsiusToKelvin(tempCelsius).toFixed(2)}K`);
console.log(`Status: ${getTemperatureStatus(tempCelsius)}`);
console.log("---");

Choose a reason for hiding this comment

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

This --- is too early. It ends separating wrong. Check this output

Weather Report for Amsterdam
Temperature: 22°C
Temperature: 71.60°F
Temperature: 295.15K
Status: Warm
---
Wind chill in Amsterdam: 22.71°C

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants