ACT5C_Mayor_1

PLease don't copy paste!
mail@pastecode.io avatar
unknown
java
2 years ago
1.3 kB
21
Indexable
Never
package com.ACT5C_Mayor_1;

import java.util.Scanner;

public class ACT5C_Mayor_1 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // Initialize variable
        double height;
        String gender, name;
        // Inputiing
        System.out.print("Enter your name: ");
        name = sc.nextLine();
        System.out.print("Enter your gender: ");
        gender = sc.nextLine();
        System.out.print("Enter your height: ");
        height = sc.nextDouble();
        // Nested-if Statement
        if (gender.equalsIgnoreCase("male") || gender.equalsIgnoreCase("boy")) {
            if (height >= 175)
                System.out.println("Hello Mr. " + name + " Welcome to Kalapati Pacific!");
            else
                System.out.println("Sorry Mr. " + name + " you are lack of height requirements.");
        }
        if (gender.equalsIgnoreCase("female") || gender.equalsIgnoreCase("girl")) {
            if (height >= 165)
                System.out.println("Hello Ms. " + name + " Welcome to Kalapati Pacific!");
            else
                System.out.println("Sorry Ms. " + name + " you are lack of height requirements.");

        }
    }
}