Question: Java if statement error with my code below. /** * Programmer David Anthony Martinez IS 2031 Senior Citizen Discount Program */ import java.util.Scanner; // Import

Java if statement error with my code below.

/** * Programmer David Anthony Martinez IS 2031 Senior Citizen Discount Program */

import java.util.Scanner; // Import the Scanner class

class MartinezDELE23Plan1

{ public static void main(String[] args) { Scanner input = new Scanner(System.in); // Create a Scanner object and capture entry System.out.printf("Please enter your age. ");

// hint not storing age value int val=input.nextInt(); // error with first calculation secondary is functional. if (val>=60) { System.out.printf("Congratulations, you are eligible for a senior citizen's discount of 10%! "); } // Code is functional below... else { System.out.printf("Sorry you don't qualify for a senior citizen's discount at this time! "); // terminates message below // System.exit(0); //Exit } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!