eate a program named SalesTaxDemo that declares an array of 10 Sale objects. Prompt the user for data for each object and display the 10 objects. Data fields for Sale objects include an inventory number, amount of the sale, and tax owed. Include a property with get and set accessors for the first two data fields, but make the tax owed a read-only property. The tax should be calculated whenever the amount of the sale is set. Assume that the tax rate is 8 percent for the first $100 and 6 percent for any amount greater than $100. 6.b. Create a program named SalesTa
6. a. Create a program named SalesTaxDemo that declares an array of 10 Sale objects. Prompt the user for data for each object and display the 10 objects. Data fields for Sale objects include an inventory number, amount of the sale, and tax owed. Include a property with get and set accessors for the first two data fields, but make the tax owed a read-only property. The tax should be calculated whenever the amount of the sale is set. Assume that the tax rate is 8 percent for the first $100 and 6 percent for any amount greater than $100.
6.b. Create a program named SalesTaxDemo2 so that after the 10 Sale objects are displayed, they are sorted in order by the amount of tax owed and displayed again. Modify the Sale class so its objects are comparable to each other based on tax owed.
Combine parts 6a and 6b into one program.
Farrell, Joyce. Microsoft Visual C#: An Introduction to Object-Oriented
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images