I have a class project i am working on that is aimed at creating an airport weighing system. The program inputs the weight of the passenger and the weight of the luggage to be transported and computes the total to find whether a passenger is eligible to travel or not. if the total is greater than the set maximum limit, the passenger is denied access but if its below, the passenger is granted a go ahead

The Project design requires one to (show the classes in UML [Unified Modeling Language] notations) clearly showing the classes, properties of the classes, the methods in the different classes and their visibility. however below is what i have tried to do

import java.util.*;

public static void main(String[] args){

Scanner input = new Scanner(System.in);

int day, month, year;
int minute, hour;
GregorianCalendar date = new GregorianCalendar();

day = date.get(Calendar.DAY_OF_MONTH);
month = date.get(Calendar.MONTH);
year = date.get(Calendar.YEAR);

minute = date.get(Calendar.MINUTE);
hour = date.get(Calendar.HOUR);

int passengerWeight;
int luggageWeight;
int totalWeight;

System.out.println("WELCOME TO EMMANUEL AIRLINE");
System.out.println("please submit in for weighing");

 System.out.println("Pease Enter passenger weight(kgs): "); 
passengerWeight = input.nextInt();

 System.out.println("Pease Enter luggage weight (kgs): "); 
luggageWeight = input.nextInt();

totalWeight = (passengerWeight+luggageWeight);

System.out.println("EMMANUEL AIRLINE");
System.out.println("Date:" + day + "/" + (month+1) + "/" + year);
System.out.println("Time:" + hour + ":" + minute);
if(totalWeight > 120)
{System.out.println("warning, weight overload");}
{System.out.println("please proceed to the reception");}

System.out.println("-------------------------THANK YOU-------------------------");


Edited by peter_budo: Post formatting

1 Year
Discussion Span
Last Post by Ant695

can any one help to show thw classes, properties of the classes, the methods in the different classes and their visibility


At a minimum, it should probably include passenger name, passenger weight, and luggage weight. Additionally, you might include address, phone number, and customer id. I don't know how many people would be honest about their weight though or be willing to step on a scale in public.

Also, are you entering the weight for each luggage separately or weighing all luggage together?

Edited by cgeier


the total weight is 120 so the persengers weight plus the laugguge put together should total up to 120 as the maximum weight each perssenger must have so if the passenger is 100 kgs he or she should not carry more than 20 kgs otherwise thank you


If you hand this code in, you will fail for sure. Start with the uml representation:

The nouns in your assignment are variables/objects. It's up to you to see from the uml which one are classes, and which ones are instance variables.

The verbs in your assignment represent the methods you need to provide.

So, long story short: you will need to provide several classes. This must also be shown in your uml diagram. Put all your code in your main method, and it will be very clear to your unstructor you didn't understand your lessons at all.

I'll give you a hint:

You'll need to have at least a class Passenger, and a class Luggage. Cgeier says that your passenger objects need at least a
"passenger name, passenger weight, and luggage weight".

This is wrong.

The Passenger actually only needs
1. passenger weight
2. an instance of luggage

And this instance of luggage, has it's own weight.

The assignment says nothing about checking his name, only his weight.


@stultuske is correct. At this stage passenger name is unnecessary. I was thinking ahead. If you continue to build on this project, in future lessons, you may need to add passenger name and some of the other things mentioned.

Edited by cgeier


Also in line 32 and 35 you spelled please wrong. Not a major deal but attention to deal is always a bonus especially when submitting the work.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.