Computer Science, asked by bhaveshbhatia30aug, 1 month ago

class Baggage
{
int weight ;
baggage(int weight)
{
this.weight=weight;
}
}
class ConveyerBelt
{
final int capacity=10;
// Declare variable to store Baggage; [1 M]
public void add(Baggage bag) // this method can be used by one thread at a time modify suitably [1 M]
{
/*this method will add bag in above declare variable. If Conveyer Belt capacity exceed it will throw CapacityExceed Exception. Use proper syntax to handle the exception Create your own CapacityExceed Exception */ [1+1++1+2 M]
}
}
class checkIn
{
public bolean CheckBaggageWeight(Baggage Bag)
{
// if Bag weight is more than 15 kg the method will return false else return true [1 M]
}
}

class Passenger // this will inherit Thread class, make suitable modification
{
/* create an constructor that will accept object of chekin, ConveyerBelt and plane class and store them in member variable */ [ 2 M]

public Boolean boardPassenger (int row, int seat)
{
//this method will change the value of array seat as per input argument. [1M]
//this method will use object of checkin to check Baggage weight if it is less than 15 it will add baggage to[3M] //ConveyerBelt

}
//override run method, this will call boardPassenger method [1M]

}
public class plane
{
int seat [][]=new int[30][6] // 30 rows having 6 seat each
//create a constructor to initialize the seat array, 0 means vacant 1 means filled. [2M]

}
Public class AirportAuthorityIndia
{
Public static void main(String args[])
{

//Create at least three passengers and start the thread. [1M]
// Set name for each thread [1M]
// main thread will wait for passenger thread to terminate [1M]

}
}

Answers

Answered by loparathod2609
3

Answer:

Luggage Weight: The Good Old Days . More than a decade ago, air passengers travelling on international flights could count on taking 2 pieces of ...

Similar questions