Can't understand the question


#1


https://www.codecademy.com/courses/learn-java/lessons/conditionals-control-flow/exercises/ternary-conditional?action=lesson_resume


public class Ternary {
	public static void main(String[] args) {
		
		int fuelLevel = 3;

		char canDrive='Y';
    
		System.out.println(canDrive);

	}
}


#2

You were supposed to use the ternary operator to check if the car has fuel.

Example of ternary operator:

//how hungry am I on a scale of 1-10
int hunger = 5;
string checkHunger = (hunger <= 5) ? "Nah you aren't hungry":'Woah buddy get yourself something to eat';
System.out.println(checkHunger);

#3

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