Answer to Question #244563 in Java | JSP | JSF for Kundie's

Question #244563
This question focuses on decision making
The program below was developed to assess if an -18 year old who is visiting the park that deserves a 10% discount given in the following scenario.
"You are told that the Kruger national park is giving away a 10% discount to children who are not more than p12 years old or a senior citizens who are at least 65 years old.it is further stated that ONLY those who are visiting the park at least the fifth time will qualify for discount
1
Expert's answer
2021-09-29T18:44:44-0400
import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
		Scanner scan  = new Scanner(System.in);
		System.out.println("Enter the year of the person");
		int year = scan.nextInt();
		if(year>=12 && year<=65){
		    System.out.println("Does not qualify for the discount\n");
		}
		else{
		    System.out.println("Enter the number of times you are visiting the park");
		    int time = scan.nextInt();
		    if(time>=5){
		       System.out.println("Qualifies for the discount\n"); 
		    }
		    else{
		        System.out.println("Does not qualify for the discount\n");
		    }
		}
	}
}

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