Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions

Question

What is the enterprises policy for geographical numbering?

Answered: 1 week ago

Question

Is conflict inevitable in organizations? Why?

Answered: 1 week ago