Answer to Question #249731 in Java | JSP | JSF for Nguu

Question #249731

To qualify for an International Conference for Women in Computing (ICWC) next year in Toronto, Canada a student have got a distinction (a mark greater than 75) in PRG510S, be a female, and below the age of 25. Write a simple program that receives a mark, gender, and age from the keyboard and displays a corresponding message basing on the input.  


1
Expert's answer
2021-10-12T00:36:55-0400

Source code

import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
	    Scanner in =new Scanner(System.in);
		System.out.println("Enter mark: ");
		int mark=in.nextInt();
		System.out.println("Choose gender:\n1. Female\n2. Male");
		int gender=in.nextInt();
		System.out.println("Enter age: ");
		int age=in.nextInt();
		
		if((mark>75 && gender==1 && age<25)){
		    System.out.println("The student is qualified for the ICWC");
		}
		else{
		    System.out.println("The student is not qualified!!");
		}
		
	}
}


Sample output 1



Sample output 2



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