Question
1. design the logic deciding whether to use AND or OR logic. write the decision statement to identify when a discount should be offered and
1. design the logic deciding whether to use AND or OR logic. write the decision statement to identify when a discount should be offered and when a disocunt should not be offered.
2. be sure to include output statemens telling whether or not the customer is eligible for a discount.
3. compile and execute
// Airline.java - This program determines if an airline passenger is // eligible for a 25% discount.
import javax.swing.*;
public class Airline { public static void main(String args[]) { String passengerName = ""; // Passenger's name. String ageString = ""; // String version of passenger's age. int passengerAge = 0; // Passenger's age.
// This is the work done in the housekeeping() method passengerName = JOptionPane.showInputDialog("Enter passenger's name: "); ageString = JOptionPane.showInputDialog("Enter passenger's age: "); passengerAge = Integer.parseInt(ageString); // This is the work done in the detailLoop() method // Test to see if this customer is eligible for a 25% discount.
// This is the work done in the endOfJob() method System.exit(0); }
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started