using System;
using [Link];
using [Link];
using [Link].X509Certificates;
using [Link];
using [Link];
namespace Expensive
{
internal class Program
{
class Income
{
public string[] Cat = { "Food", "Rent", "Entertainment",
"Transportation", "Utilities" };
public double[] Amt = new double [5];
public double[] BUD = new double[5];
public double totalincome;
public double income;
static void Main(string[] args)
{
Income A = new Income();
while (true)
{
[Link]("Welcome to your no 1 finance program");
[Link]("1:Add income");
[Link]("2:Add Expense");
[Link]("3:Set budget");
[Link]("4:View reports");
[Link]("5:Exit");
string choice = [Link]();
switch (choice)
{
case "1":
[Link]("Enter income amount:");
string check = [Link]();
try
{
[Link] = [Link](check);
}
catch (FormatException)
{
[Link]("Invalid input. Please enter a
numeric value for income.");
}
if ([Link] < 0)
{
[Link]("Income cannot be negative.");
}
else
{
[Link]("Income added successfully.");
}
[Link]("Your total income is: " + [Link]);
break;
case "2":
[Link]("Enter your spent amount in given
fields");
string EA = "";
double EI =0;
for (int i = 0; i < [Link]; i++)
{
[Link]([Link][i] + ":");
EA = [Link]();
try
{
EI = [Link](EA);
}
catch (FormatException)
{
[Link]("Invalid input. Please enter a
numeric value for income.");
}
if (EI < 0)
{
[Link]("Income cannot be negative.");
}
else
{
[Link]("Income added successfully.");
[Link][i] = EI;
}
}
break;
case "3":
[Link]("Enter your Budget amount in given
fields");
string BR = "";
double BO = 0;
for (int i = 0; i < [Link]; i++)
{
[Link]([Link][i] + ":");
BR = [Link]();
try
{
BO = [Link](BR);
}
catch (FormatException)
{
[Link]("Invalid input. Please enter a
numeric value for income.");
}
if (BO < 0)
{
[Link]("Income cannot be negative.");
}
else
{
[Link]("Income added successfully.");
[Link][i] = BO;
}
double budgetedAmount = [Link][i];
}
break;
case "4":
double ALL = 0;
double BD = 0;
double total = 0;
[Link]("Your Expenses are:");
for (int j = 0; j < [Link]; j++)
{
[Link]("Budgeted Amount for " + [Link][j] +
": " + [Link][j]);
[Link]([Link][j] + ": " + [Link][j]);
ALL += [Link][j];
BD += [Link][j];
}
[Link]("Your Total Income is: " + [Link]);
[Link]("Total Expense " + ALL);
[Link]("Your remaining balance is: " + total);
if(ALL>BD)
{
[Link]("You have exceeded your budget!");
}
else
{
[Link]("You are within your budget.");
}
break;
case "5":
[Link](0);
break;
default:
[Link]("Invalid choice. Please try again.");
break;
}
}
}
}
}
s