https://www.codecademy.com/courses/learn-java/lessons/introduction-to-java/exercises/generalizations?action=lesson_resume


#1



Replace this line with your code.

https://www.codecademy.com/courses/learn-java/lessons/introduction-to-java/exercises/generalizations?action=lesson_resume


#2

Well lets work through the lesson together! :smiley:
Step 1.) Write a single line comment anywhere you want. It can be anything! (Make sure it starts with //)
So this should be relatively easy. We are to write a comment anywhere using //. So, I put mine a line above my main code and it should look something to this nature:

//put your comment in here mwahaha

Step 2.) Set the boolean variable isComplete to true
So your code right now should look like this: boolean isComplete; so how to we set a variable to a certain value? equal sign! So lets set our variable to true.

boolean isComplete = true;

Step 3: Set the int variable awesomeLevel equal to 121.
So once again we are equaling a variable to a certain value. In this case, awesomelevel is being set equal to 121 so your code should look something like this:

int awesomeLevel = 121;

Step 4.) Set the int variable epicLevel equal to awesomeLevel multiplied by 2.
So once again we are setting a variable to a certain value but this time our value is more complex in nature. So lets set epicLevel equal to awesomeLevel to start off.

int epicLevel = awesomeLevel

So how do we multiple awesomeLevel by 2? Using the * key! so our final code for this step should equal something like this:

int epicLevel = awesomeLevel

Step 5.) Uncomment the last line so that the console prints out the value of epicLevel.
So now just get rid of the /* on each side of the last line of your code to comment it.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.