NOTE: String processing methods of String class should be used where necessary!!
Institution Name
Accreditation
NUST
Yes
UNAM
Yes
Space Institute
No
Sample run1:
Enter points and institution: 60 NUST F
Output: Loan Award Successful and application gender is: FEMALE
import java.util.Scanner;
public class Main
{
public static void main(String args[]) throws Exception
{
String institution, gender;
int points;
float weight;
Scanner input=new Scanner(System.in);
System.out.print("Enter institution: ");
institution= input.nextLine();
System.out.print("Enter Gender (Male/Female): ");
gender=input.next();
System.out.print("Enter points: ");
points=input.nextInt();
if(gender=="m"){
System.out.println("Gender is MALE ");
}
else if(gender=="f"){
System.out.println("Gender is FEMALE ");
}
if(points>25 && points<100){
System.out.print("You qualify for the scholarship");
}
else{
System.out.print("You do not qualify for the scholarship");
}
System.out.println("\nGender: MALE ");
}
}
Comments
Leave a comment