Create the following:
1. Class Shipment ( the node ) that includes four instance variables:
int ShipNo; // the Shipment No.
String CustName; // the Customers name
String Dest; // the Shipment Destination – DMM, RUH, JED.
char Status; //the Shipment status ( P paid – U unpaid )
Shipment next; // points to the next Shipment
Default and overloaded constructors
2. Class Company that includes two instance variables:
Shipment head;
Shipment Tail;
Your class should have the following:
• A method that initializes the instance variables.
• void addShipment (int, String, String, char) creates and adds the Shipment’s information ( ShipNo, CustName, Dest. and Status) in the singly linked list.
• void deleteShipment (int No) to delete a Shipment in the single linked list.
• void printAllShipments() prints all Shipments in the single linked list.
• void printUnShipments() prints all the (Unpaid) Shipment in the single linked list (based on the status of the Shipment).
• void printRUHShipments() pr
Create the following: 1. Class Shipment ( the node ) that includes four instance variables: int ShipNo; // the Shipment
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am