Sales Tax Calculator
DebatPay
786 views
Welcome!
This C# playground demonstrates a simple sales tax calculation module that hasn't been tested yet, Can you find the errors and fix the code before it's used by customers?
Hands-on Demo
Golly, what is wrong with my sales tax calculator?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
using System.Linq;
using System.Text;
namespace Answer
{
public class SalesTaxCalculatorStub
{
public static decimal GetTotalAmount(decimal itemPrice, decimal taxRatePercent)
{
decimal taxRate = taxRatePercent / 10 ; //fix me
return itemPrice + (itemPrice * taxRatePercent); //what?
}
}
}
//}
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.