Answer to Question #247567 in Java | JSP | JSF for Nelly

Question #247567
  1. 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 and m for male) separated by spaces and determine if the student qualifies for an award or not. The program should also, print their gender in full and capitalized

 

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

 

  1. Defining diagram 
  2. Pseudocode 
  3. Flowchart 
  4. Java program  
1
Expert's answer
2021-10-07T03:05:12-0400
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 ");
                                  
    }
}

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