Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

Define the term Working Capital Gap.

Answered: 1 week ago

Question

Bachelors degree in Information Systems or Statistics

Answered: 1 week ago