Lab Program 12
Lab Program 12
import java.util.Scanner;
if(a>bucketSize)
else {
while(a>b){
a-=b;
}
if (a>0)
Scanner t;
t=new Scanner(System.in);
int op=t.nextInt();
t=new Scanner(System.in);
int n=t.nextInt();
t=new Scanner(System.in);
System.out.println("Enter the size of each packets....");
for(i=1;i<=n;i++)
{
size[i]=t.nextInt();
}
t=new Scanner(System.in);
for(i=1;i<=n;i++){
bktInput(size[i],op);
}
OUTPUT
25
Packet no 1
Bucket overflow, Hence Packet discarded
Packet no 2
25 bytes sent
25 bytes sent
25 bytes sent
25 bytes sent
Packet sent successfully
Packet no 3
25 bytes sent
25 bytes sent
Packet sent successfully