Creating a program with an if statement but no else statement

I have come across this question: In order to pass a certain unit, a student has to get a mark of at least 50 in the totalMark . Set the variable grade to either “Pass” or “Fail” according to this rule. Complete the following code using only a single if … WITHOUT else statement and print the results. (write the if statement and print the result only)

What code would I add after this?

Scanner dataInput = new Scanner(;
System.out.println("Enter the total mark: ");
int totalMark = dataInput.nextInt();
String grade = "Pass";

Probably the if statement asked for in the instructions.

Yeah but what would that if statement look like?

Under what condition would you change the value of grade from “Pass” to “Fail”?

That’s what you are helping me figure out.

From the code you have so far and the instructions, you are asking a user for input. What is the input? A variable is assigned to that input. What is the name of the variable? You have another variable named grade. It has the default value of "Pass" assigned to it. If you change nothing, every student passes regardless of what integer value is entered and assigned to totalMark. The assignment is to write an if statement (the condition) under which you will change the default value of "Pass" to "Fail". What is the condition? The answer to that question is in the first sentence of the assignment.