Answer to Question #235723 in Java | JSP | JSF for sandyJay

Question #235723

create a Java Program that will display this:

You are told that the Kruger National Park is giving away a 10% discount to children who are not more than 12 years old or senior citizens who are at least 65 years old. It is further stated that ONLY those who are visiting the Park for at least the 5th time will qualify for this discount.

1) Write your program in question (I) in such a way that method decideDiscount() can return a value to the calling method. The calling method will then display if a customer qualifies for a discount or not.


1
Expert's answer
2021-09-10T12:17:00-0400
public class Main {
    private static boolean decideDiscount(int age, int visit) {
        return (age <= 12 || age >= 65) && visit >= 5;
    }

    public static void main(String[] args) {
        System.out.println("Qualified: " + decideDiscount(64, 5));
    }
}

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