CJCoding With Joseph

Discounted Product Price

Product stores a price and has a virtual method Price returning it. SaleProduct overrides Price to return the base price minus a 10 discount. Use base.Price() in your override. Do NOT write a Main method.

For new SaleProduct(50) the program prints:

40

Expected Output:

40
Topics:
Inheritance
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.