Question
Help me compile this code done in Java. This program is to compare the amount of baggage and give the traveler's information. Please give the
Help me compile this code done in Java. This program is to compare the amount of baggage and give the traveler's information.
Please give the code (Java) and show a screenshot of this program working.
package demo;
public class TravelInformation { public static void main(String args[]) { private final int customerId = 1001; private int travelerId; private int BaggageAmount; private int expiryyear; private boolean nocStatus; public int getTravelerId() { return travelerId; } public void setTravelerId(int travelerId) { this.travelerId = travelerId; } public int getBaggageAmount() { return BaggageAmount; } public void setBaggageAmount(int baggageAmount) { BaggageAmount = baggageAmount; } public int getExpiryyear() { return expiryyear; } public void setExpiryyear(int expiryyear) { this.expiryyear = expiryyear; } public boolean getNocStatus() { return nocStatus; } public void setNocStatus(boolean nocStatus) { this.nocStatus = nocStatus; } public int getId() { return customerId; } public boolean CheckBaggage() { boolean ret = false; if (this.BaggageAmount >= 0 && this.BaggageAmount <= 40) { nocStatus = true; ret = true; } else { nocStatus = true; System.out.println("Invalid baggage amount"); } return ret; } } }
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