Exe2: Creating a Package class and its child class The Package class includes 1. auto-implemented properties for an ID n
Posted: Tue Jul 12, 2022 8:21 am
Exe2: Creating a Package class and its child class The Package class includes 1. auto-implemented properties for an ID number, recipient's name, and weight in ounces. 2. public Package (string number, string recipientName, double weight) - This constructor takes three arguments and assigns them to the appropriate fields. 3. Define method named GetPrice to calculate the delivery price for the Package object, Price depends on weight, the price is $5 for the first 32 ounces and 12 cents per ounce for every ounce over 32. Create a child class named InsuredPackage, which includes: a field for the package's value. Override the method GetPrice that sets a Package's delivery price to include insurance, which is $1 for packages valued up to $20 and $2.50 for packages valued $20 or more. In your main method write the code to do the following: 1. Create an object for Package class 2. Create an obejct for InsuredPackage class 3. Display two objects' delivery price.