Answer to Question #251096 in Java | JSP | JSF for Amadix

Question #251096

To qualify for a loan award, a student should score between 25 - 100 points and should have been admitted to an accredited institution. write a program that accept points, institution and their gender(f for female an m for male) seperated by spaces and determine if the student qualifies for an award or not. The program should also, print their gender in full and capitalized. Please see sample runs below for appropriete massages/input/output. Use table for program.


1
Expert's answer
2021-10-14T07:55:21-0400
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("Score, Institution, Gender : ");
        int score = in.nextInt();
        String institution = in.next();
        String gender = in.next();

        if (gender.equalsIgnoreCase("f")) {
            System.out.println("FEMALE");
        } else if (gender.equalsIgnoreCase("m")) {
            System.out.println("MALE");
        } else {
            System.out.println("?");
        }
        if (score >= 25 && score <= 100) {
            System.out.println("Qualified");
        } else {
            System.out.println("Not Qualified");
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS