Computed Property With Logic
mediumQuestion 561Create a class Order whose constructor stores a private double total. Add a read-only property FinalPrice: when total is greater than 100 it returns the total minus one tenth of the total (a 10% discount); otherwise it returns the total unchanged. Do not write a Main method.
For a total of 200 the program prints the output shown in Expected Output.
For a total of 50 the program prints: 50
Expected output
180= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
Encapsulation
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · 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.