 ## Saving Calculator in C#

Saving Calculator is a simple console application in Visual C#. In this application, We assume that a pensioner has 3 sources of income. They are pension, rent and gift from his children. Here we want to receive these varying amounts from the user. Then, we have to output the following

• Total Income:- (Sum of incomes through all three sources)
• Saving Amount:- (Remaining after spending)
• Tax Status:- (Eligible to pay tax if the total income is greater than 50000)
• Tax Amount:- (8% of total income if he is eligible to pay tax)

### Implementation of Salary Calculator in C#

```static void Main(string[] args)
{
//Declaration of Variables
double pension, rent, gift, total, spent, saving, tax = 0;
string status = "Non Tax Payee";

//Displaying an Instruction
//Getting the user input and converting to Integer

Console.WriteLine("Enter the amount spent :");

//Getting the total
total = pension + rent + gift;

//Getting the saving
saving = total - spent;

//Checking whether entitled to pay tax or not
if (total >= 50000)
{
status = "Tax Payee";
tax = 0.08 * total;
}

//Outputs
Console.WriteLine("ToTal Income \t\t: Rs." + total);
Console.WriteLine("Saving Amount \t\t: Rs." + saving);
Console.WriteLine("Tax Status \t\t: " + status);
Console.WriteLine("Tax Amount \t\t: Rs." + tax);

//ReadKey() will wait until a key is pressed.
//So that we can see the output