Page 1 of 1

Create the following: 1. Class Shipment (the node ) that includes four instance variables: int Ship No: // the Shipment

Posted: Sat Nov 27, 2021 10:34 am
by answerhappygod
Create The Following 1 Class Shipment The Node That Includes Four Instance Variables Int Ship No The Shipment 1
Create The Following 1 Class Shipment The Node That Includes Four Instance Variables Int Ship No The Shipment 1 (81.93 KiB) Viewed 51 times
Create The Following 1 Class Shipment The Node That Includes Four Instance Variables Int Ship No The Shipment 2
Create The Following 1 Class Shipment The Node That Includes Four Instance Variables Int Ship No The Shipment 2 (81.93 KiB) Viewed 51 times
Create the following: 1. Class Shipment (the node ) that includes four instance variables: int Ship No: // the Shipment No. String CustName: // the Customers name String Dest; // the Shipment Destination - DMM, RUH, JED. char Status; //the Shipment status (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 ShinNo. CustName Dest and Status) in the singly linked list void deleteShipment (int No) to delete a Shipment in the single linked list. • void printaushirments prints all Shipments in the single linked list .void printlo Shipments prints all the (Unpaid) Shipment in the single linked list (based on the status of the Shipment). • void printRuhshipments prints all the Shipment in (Riyadh) destination in the single linked list (based on the Destination of the Shipment). - int countanshipments counts the number of Shipments in the list. I Write a test application. In the main method, do the following. a • Create a Company object. • Ask the user to enter the number of Shipments to be added in the Company • Input the ShinNo CustName. Dest, and Status of each Shipment and add it to the Company class (Hint: Use a loop) • Print all Shipments Input the ShipNo of the Shipment to be deleted. Delete the Shipment. • Print all Shipments. Print all Un Paid Shipments. • Print all Shipments in (Riyadh) Destination in the list • Print the number of Shipments in the list . 2