Hvala vam na ukazanom greškama ali bi meni a i drugim(neznalicama koje su krenule od nule) više pomoglo da ste naveli neki primjer.Sve sam poništila pa ću pokušati kasnije.U svakom slučaju hvala!
You are really close. You just have a syntax problem which was mentioned earlier. Try to see if you can incorporate par into you if else statements. Also careful of casing here.
I will give you an example of where your logic is wrong.
else if(strokes <= -2){
return "Eagle";
}
An Eagle in golf is when the number of strokes is 2 less than the par. Right now you are checking if strokes is less than or equal to -2. That will never be the case because strokes will always be a positive number. What you want to check is if the number of strokes is 2 less than the par.
And then you’ll need to make the same sort of changes for Birdie, Bogey, and Double Bogey. Notice that you have Par correct though because you are checking if the number of strokes equals the par. And Hole-in-one is correct because you don’t need to compare the number of strokes to the par, a hole in one is always one stroke.
prvo pokušajte sami riješiti izazov. napišite kod koji znate i potražite greške i ispravite ih. kada ne dobijete traženi izlaz, postoji problem u logici, potražite savjet i naučite i promijenite kôd.