Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
