a. Create an application named OrderDemo that declares and uses Order objects. The Order class performs order
Question:
• An Equals() method that determines two Orders are equal if they have the same order number
• A GetHashCode() method that returns the order number
• A ToString() method that returns a string containing all order information
The OrderDemo application declares a few Order objects and sets their values. Make sure to create at least two orders with the same order number. Display the string from the ToString() method for each order. Write a method that compares two orders at a time and displays a message if they are equal. Send the Orders you created to the method two at a time and display the results.
b. Using the Order class you created in Exercise 3a, write a new application named OrderDemo2 that creates an array of five Orders. Prompt the user for values for each Order. Do not allow duplicate order numbers; force the user to reenter the order when a duplicate order number is entered. When five valid orders have been entered, display them all, plus a total of all orders.
c. Create a ShippedOrder class that derives from Order. A ShippedOrder has a $4.00 shipping fee (no matter how many items are ordered). Override any methods in the parent class as necessary. Write a new application named OrderDemo3 that creates an array of five ShippedOrders. Prompt the user for values for each, and do not allow duplicate order numbers—force the user to reenter the order when a duplicate order number is entered. When five valid orders have been entered, display them all, plus a total of all orders.
d. Make any necessary modifications to the ShippedOrder class so that it can be sorted by order number. Modify the OrderDemo3 application so the displayed orders have been sorted. Save the application as OrderDemo4.