Take a look here:
class Question05
{
public static void main(String[] args)
{
double gpa = Double.parseDouble(args[0]);
String res = gpa >= 3.6?"First class Hons":(gpa<3.6 && gpa>=3.4?"Upper Second Class Hons": (gpa<3.4 && gpa>=3.0?"Lower Second Class Hons": (gpa<3.0 && gpa>=2.0?"Pass":"you have failed")));
System.out.println(res);
}
}
Edit: @veena, you were trying to assign a string to gpa, which was declared as a double!!!
2
solved use ternary operator to solve multiple conditions [closed]