Answer to Question #317080 in C# for Laura

Question #317080

How are you getting the prices of the bill?


1
Expert's answer
2022-03-24T16:26:32-0400

https://www.nasdaq.com/articles/how-calculate-price-treasury-bills-2016-01-05

https://jeremyshanks.com/creating-a-simple-tax-calculator-console-app-in-csharp/

public class TaxCalculator
{
    private static decimal _itemPrice;
    private static decimal _percentTaxRate;
    private static decimal _totalPrice;

    public TaxCalculator(string inputItemPrice, string inputTaxRate)
    {
        _itemPrice = Decimal.Parse(inputItemPrice);
        _percentTaxRate = Decimal.Parse(inputTaxRate) / 100;
    }

    public void CalculateTotalPrice()
    {
        _totalPrice = _itemPrice + (_itemPrice * _percentTaxRate);
    }

    public void GetTotalMsg()
    {
        Console.WriteLine("The subtotal is {0:C} and the total price is {1:C} at the tax rate of {2:p0}", _itemPrice, _totalPrice, _percentTaxRate);
    }
}

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
New on Blog
APPROVED BY CLIENTS