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

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!