Java Java Basics Perfecting the Prototype Conditional ints

Conditional.java Challenge Task 1

I don't understand what is needed to be done

Conditional.java
int numberOfPeople = "3";
if (numberOfPeople < 3)

1 Answer

Tabatha Trahan
Tabatha Trahan
18,393 Points

The challenge is asking you to add a statement to the conditional (if statement). So if the number of people is less than 4, print out to the console "Your table is ready". It looks like you'll be using the console.printf method for this challenge. Make sure to open the block of code containing your print statement with an opening curly brace, and close it with the closing curly brace. The if statement is comparing the value of your numberOfPeople variable to the number 4. If this condition is true, you will execute the block of code that follows your condition statement. If the condition is false, the program will skip that block and continue on. Post here if you run into any issues. It also helps a lot to follow along with the videos by using workspaces since the concepts reviewed in the videos are very similar to what the challenges ask for. I hope this helps.