## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Jun 19 2020 20:09
@krisb1220 banned @Gastony
• May 14 2020 22:38
• May 14 2020 22:37
@bjorno43 banned @real-action
• Feb 01 2020 00:26
@bjorno43 banned @Ndoua
• Jan 07 2020 03:10
@bjorno43 banned @doctor-sam
• Aug 17 2019 09:33
• Jun 20 2019 21:19
@bjorno43 banned @shenerd140
• May 10 2019 09:13
@bjorno43 banned @zhaokunhaoa
• Apr 25 2019 17:12
@mstellaluna banned @cmal
• Apr 01 2019 18:11
thecodingaviator labeled #31179
• Apr 01 2019 18:11
thecodingaviator labeled #31179
• Apr 01 2019 18:09
thecodingaviator commented #31179
• Apr 01 2019 18:09
thecodingaviator labeled #31182
• Apr 01 2019 18:09
thecodingaviator labeled #31182
• Apr 01 2019 18:07
thecodingaviator commented #31182
• Apr 01 2019 18:07
thecodingaviator labeled #31190
• Apr 01 2019 18:07
thecodingaviator labeled #31190
• Apr 01 2019 18:07
thecodingaviator commented #31190
• Apr 01 2019 18:05
thecodingaviator commented #31157
• Apr 01 2019 18:04

thecodingaviator on master

remove A (#31157) (compare)

kumquatfelafel
@kumquatfelafel
tiger500
@tiger500

@kumquatfelafel function convertToF(celsius) {
var fahrenheit;
// Only change code below this line

// Only change code above this line
return fahrenheit;
}

// Change the inputs below to test your code
convertToF(30);

kumquatfelafel
@kumquatfelafel
@tiger500 Did you try doing what @saifsmailbox98 said?
tiger500
@tiger500
yeah when i get the 2nd correct i get the 3rd one wrong @kumquatfelafel
Ednor
@ednor
@Chrono79 what about Strokes = Par, does that mean Par = 0 ?
kumquatfelafel
@kumquatfelafel
@ednor When strokes === par, you return "Par". for example
Diego Mayer
@Chrono79
@ednor no, and use == or === to compare when not specified, = is used to assign values
capitalization matters
kumquatfelafel
@kumquatfelafel
@tiger500 Let me see what you tried to do with saif. Maybe we can figure out what went wrong.
tiger500
@tiger500

function convertToF(celsius) {
var fahrenheit=0;

// Only change code below this line
fahrenheit=(-30+8);
fahrenheit=(-10+24);

// Only change code above this line
return fahrenheit;
}

// Change the inputs below to test your code
convertToF(30);

Ednor
@ednor
@Chrono79 what about Strokes = Par, does that mean Par = 0 ?
There is column where Par has any value
tiger500
@tiger500

@kumquatfelafel function convertToF(celsius) {
var fahrenheit=0;

// Only change code below this line
fahrenheit=(-30+8);
fahrenheit=(-10+24);

// Only change code above this line
return fahrenheit;
}

// Change the inputs below to test your code
convertToF(30);

Diego Mayer
@Chrono79

@ednor

@ednor When strokes === par, you return "Par". for example

Strokes        Return
1        "Hole-in-one!"
<= par - 2        "Eagle" //you compare strokes against par - 2 here, using <=
par - 1        "Birdie"
par        "Par"
par + 1        "Bogey"
par + 2        "Double Bogey"
= par + 3        "Go Home!"
kumquatfelafel
@kumquatfelafel
@tiger500 alright. Well you're not using the conversion formula here. You're just hardcoding values. You need to use the formula. So what's the formula to convert celsius to fahrenheit?
tiger500
@tiger500
@kumquatfelafel celsius9/5+2
Ednor
@ednor
@Chrono79, in this challenge, I must use if ... return; else if (*n) ... return; and else ... return;
kumquatfelafel
@kumquatfelafel
@tiger500 the formula we use to convert fahrenheit to celsius is Fº = Cº * 9/5 + 32.
Diego Mayer
@Chrono79
@ednor yes, all the if/else you need to address all cases
kumquatfelafel
@kumquatfelafel
@tiger500 do you have a variable that represents the temperature in Fº in your code?
Ednor
@ednor
@Chrono79 ,here is what i've tried, but failed

function golfScore(par, strokes) {
// Only change code below this line

if (par > 1) {
return "Hole-in-one";
} else if (par <= -2) {
return "Eagle";
} else if (par <= -1) {
return "Birdie";
} else if (par >= 1) {
return "Par";
} else if (par >= 1) {
return "Bogey";
} else if (par >= 2) {
return "Double Bogey";
} else if (par >= 3) {
return "Go Home!";
}
else {
return "Change Me";
}
// Only change code above this line
}

// Change these values to test
golfScore(5, 4);
Harry Fahringer III
@harryrf
Any idea what I'm still doing wrong here? https://codepen.io/harryrf3/pen/EXVWdv?editors=1010
My button changes from fahrenheit to celsius, but not back
Diego Mayer
@Chrono79
@ednor where is strokes there?
Ednor
@ednor
@ednor where is strokes there?
Euh !!!
tiger500
@tiger500
@kumquatfelafel no
kumquatfelafel
@kumquatfelafel
@tiger500 you don't see a variable you could use to store the temperature in ºF?
Ednor
@ednor
@Chrono79, so instead of using par as variable, it should be strokes, right ?
kumquatfelafel
@kumquatfelafel
@ednor both par and strokes are important.
Diego Mayer
@Chrono79
@ednor par and strokes are your function parameters, you have to use both (not in all cases)
strokes is needed in all your if conditions, compare it against the values of the table's first column
tiger500
@tiger500
@kumquatfelafel fahrenheit
kumquatfelafel
@kumquatfelafel
@tiger500 yep
Ednor
@ednor
@Chrono79, @kumquatfelafel, I am COMPLETELY lost
tiger500
@tiger500
@kumquatfelafel Celsius
Diego Mayer
@Chrono79
@ednor
if (strokes == 1) {
return "Hole-in-one!"; // <- the string must be exactly what they wrote
Complete it with the other cases
Ednor
@ednor
ok @Chrono79 , let me continue with your logic
kumquatfelafel
@kumquatfelafel
@tiger500 close. Is it written exactly as Celsius in your code?
AnonimoProgrammatore
@AnonimoProgrammatore

sorry guys but the RegEx

/\W/g

it's supposed to comprend "_" underscore too, right?

Diego Mayer
@Chrono79
@AnonimoProgrammatore \w is all letters, all numbers and _
\W is not all that
tiger500
@tiger500
@kumquatfelafel Celsius time
Joseph
@revisualize
Hello.
Diego Mayer
@Chrono79
:wave:
Ednor
@ednor
@Chrono79 , what is the condition when strokes return Par
?
Joseph
@revisualize
@ednor strokes return par?
Diego Mayer
@Chrono79
@ednor strokes == par but that's the last one I'll give you, you're on your own from there
Try to see the logic of comparing strokes against the first column and returning the second, that's how you normally read a table
AnonimoProgrammatore
@AnonimoProgrammatore
@Chrono79 Thanks you, I tought that "_" was not in \w
CamperBot
@camperbot
anonimoprogrammatore sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 4432 | @chrono79 |http://www.freecodecamp.com/chrono79
Ednor
@ednor
Okay @revisualize and @Chrono79