Help, I can't finish this simple project (FizzBuzz project)

https://www.codecademy.com/courses/learn-java/projects/java-fizzbuzz

Hi, I am a person that really wants to learn how to code so I can use this skill in the future. I’m only in 7th grade and having trouble with doing this project. So, if anyone can help me I would be very glad.

I’m doing a FizzBuzz project and it just isn’t working. Here’s my solution to the project.
class FizzBuzz {

public static void main(String[] args) {

var fizzBuzz = function(){
for(i = 1; i < 100; i++){

if(i % 3 === 0 && i % 5 === 0){
console.log(“FizzBuzz”);
}
else if(i % 5 === 0){
console.log(“Buzz”);
}
else if (i % 3 === 0){
console.log(“Fizz”);
}
else{
console.log(i);
}
}
}

And I just keep getting this a loop of 1-100 without fizz, Buzz, or FizzBuzz.

Code is sensitive to changes and should be shared as exact copies, if you look at your post… that’s probably not how you formatted it.

Take a look at the buttons in the post editor, one of them is for telling the forum not to apply other formatting rules to code/other text

Also, looks like you’re mixing different languages, might want to stick to one language per file …

Also, please don’t write a whole program and then run it only to find that it “doesn’t work”.
Start with something minimal, maybe you’d make a program that says hi and then exits. When that’s running successfully, make some small change and then run it again to see if your change had the desired effect. Repeat until done.

1 Like

@ionatan I’m sorry but that did not really help at all. I tried doing that but every time I do, I just make the code worse :frowning:

Hi design2868347494,

your issue is caused by double quotes in console.log(). Try use single quotes, it should work.

Also I see that you use JS syntax while in the path it says ‘learn-java’. This might be also a reason why it doesn’t work in your environment. But it works as is (with changing of quotes) in console or terminal.

So I’m using the wrong language, what should I fix about it?