java

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

java

Post by answerhappygod »

java
Java 1
Java 1 (29.39 KiB) Viewed 72 times
Java 2
Java 2 (63.19 KiB) Viewed 72 times
Create the following: 1. Class Shipment (the node ) that includes four instance variables: Int Ship the shipment No. String CustName / the Customers same String Dest; // the Shipment Destination-DMM, RUH, JED. char Status://the Shipment status (paid - Uuspaid) Shipment nest points to the next Shipment Default and overloaded constructors 2. Class Company that Indudes 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 (Shipro, CustName, Dest, and Status) in the singly linked list. .vold deleteShipment (int No) to delete a Shipment in the single linked list. .vold printAllShipments prints al Shipments in the single linked list vold printun shipments prints at the (Unpaid) Shipment in the single linked list (based on the status of the Shipment) vold printRhShipments) prints all the shipment in (Riyadh) destination in the single linked list (based on the Destination of the shipment) - int countAllShipments (counts the number of Shipments in the list. Write a test application. In the main method, do the following: • Create a Company object • Ask the user to enter the number of Shipments to be added in the Company • Input the ShipNo, Oust Name, Dest. and Status of each Shipment and add it to the Company dass (Hint: Use a loop)

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() prints all the Shipment in (Riyadh) destination in the single linked list (based on the Destination of the Shipment). • int countAllShipments () counts the number of Shipments in the list. Write a test application. In the main method, do the following: • Create a Company object. • Ask the user to enter the number of Shipments to be added in the Company, • Input the ShipNo, 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 UnPaid Shipments. • Print all Shipments in (Riyadh) Destination in the list. • Print the number of Shipments in the list.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply