akosiraff

Download OrderDemo

Dec 6th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/orderdemo/
  3. Create a class named Order that performs order processing of a single item that sells for $19.95 each. The class has four variable fields: order number, customer number, customer name, quantity ordered, and total price. Create a constructor that requires parameters for all the fields except the total price. Include public get and set accessors for each field except the total price field; that field is calculated as quantity ordered times the unit price (19.95) whenever the quantity is set, so it needs only a get accessor. Also create the following for the class:
  4. 1. An Equals() method that determines two Orders are equal if they have the same order number.
  5. 2. A GetHashCode() method that returns the order number.
  6. 3. A ToString() method that returns a string containing all order information.
  7. Write an application that declares a few order objects and sets their values, making sure to create at least two 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 create to the method two at a time and display the results. Save the file as OrderDemo.cs
  8. Download: http://solutionzip.com/downloads/orderdemo/
Add Comment
Please, Sign In to add comment