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.
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));
}
}
Comments
Leave a comment