Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 6 - 3 Enhance the Invoice Total application In this exercise, you'll enhance the Invoice Total application from chapter 5 s o it uses
Exercise Enhance the Invoice Total application
In this exercise, you'll enhance the Invoice Total application from chapter it uses a method with a tuple.
Add a GetInvoiceAmounts method
Open the application that's in the :#VInvoiceTotal directory.
Add a method named GetInvoiceAmounts that accepts the customer type and subtotal and returns the discount percent. You can do that manually or using refactoring.
Test the application to make sure the new method works correctly.
Add a tuple
Modify the declaration for the GetInvoiceAmounts method so it returns a tuple that includes the discount percent and the discount amount. Then, modify the code for this method so it works with the tuple.
Modify the calling code so it deconstructs the tuple that's returned by the GetInvoiceAmounts method. When you do that, you can delete the statements that declare and calculate the discount amount and invoice total.
Test the application to make sure the changes work.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started