So i have an assignment that requires me to program and create freight Id and update the status for every new order.
Freight ID: This should be a unique number auto generated using the following simple algorithm.
• Use the numbers '1939' as the first freight Id. Increment it by 1 for the next freight.
Freight status: can be one of the codes: ‘D’,’P’, or ‘W’.
“D”: Delivered to the destination
“P”: Processing
“W”: Waiting at the ware house to be delivered.
When a new freight order is created, its initial status should be recorded as ‘W’.
I have tried some ways but i just cant seem to understand how I should auto generate and increment a freight ID as well as create a freight status.
public void freightID()
{
int [] freightID = {1939,1939,1939,1939,1939};
for (int i = 0; i<ID_SIZE; i++)
{
int answer = ++freightID[0];
System.out.println(freightID[i]*1);
}
}
I know this is completely wrong but i just wanted to show what i tried.