Answer to Question #210840 in C# for John Cena

Question #210840

Add a static member to store Service Tax, which is set to 12.3%. Also allow a property through which we can set and get service tax.

Modify TotalFee and DueAmount properties to consider service tax.


1
Expert's answer
2021-06-27T14:10:47-0400
public class Tax
    {
        public double ServiceTax { get; set; }


        public double DueAmount { get; set; }


        public double TotalFee
        {
            get
            {
                return DueAmount + DueAmount * ServiceTax;
            }
        }


        public Tax()
        {
            ServiceTax = 0.123;
        }
    }

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS