i am trying to figure it out, and i cant get the income and the SSN to show
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Assignment5_Koch
{
class Rates
{
public readonly int incomeLimit;
public readonly double lowTaxRate;
public readonly double highTaxRate;
public Rates()
{
incomeLimit = 30000;
lowTaxRate = .15;
highTaxRate = .28;
}
public Rates(int limit, double lowRate, double highRate)
{
incomeLimit = limit;
lowTaxRate = lowRate;
highTaxRate = highRate;
Taxpayer tt = new Taxpayer();
tt.taxOwed = tax;
}
public void CalculateTax(double income)
{
double tax;
if (income < incomeLimit)
{
tax = income * lowTaxRate;
}
if (income > incomeLimit)
{
tax = income * highTaxRate;
}
}
}
class Taxpayer// : IComparable
{
public string socialSecurityNumber { get; set; }
public int yearlyGrossIncome { get; set; }
public readonly double taxOwed;
public void getRates()
{
int incomeLimit;
double lowRate;
double highRate;
Console.WriteLine("Do you want default values (enter D) or enter your own (enter O)?");
char values = Convert.ToChar(Console.ReadLine());
if (values == 'd' || values == 'D')
{
Rates deval = new Rates();
incomeLimit = deval.incomeLimit;
lowRate = deval.lowTaxRate;
highRate = deval.highTaxRate;
deval.CalculateTax(yearlyGrossIncome);
}
if (values == 'o' || values == 'O')
{
Console.WriteLine("Enter the dollar limit:");
incomeLimit = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the low rate:");
lowRate = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter the high rate:");
highRate = Convert.ToDouble(Console.ReadLine());
}
}
}
class assignment5_Koch
{
public static void Main(string[] args)
{
string[] socialSecurityNumber = new string[5]; //array for SSNs
int[] grossIncome = new int[5]; //array for gross Incomes
double[] taxArray = new double[5];
string inputstring;
for (int x = 0; x < socialSecurityNumber.Length; ++x)
{
Console.WriteLine("Enter Social Security Number for taxpayer 1:");
inputstring = Console.ReadLine();
socialSecurityNumber[0] = inputstring;
Console.WriteLine("Enter gross income for taxpayer 1:");
inputstring = Console.ReadLine();
grossIncome[0] = Convert.ToInt32(inputstring);
Taxpayer own = new Taxpayer();
own.yearlyGrossIncome = grossIncome[0];
Rates tp1 = new Rates();
tp1.CalculateTax(own.yearlyGrossIncome);
own.getRates();
taxArray[0] = 0 ;
}
for (int x = 0; x < socialSecurityNumber.Length; ++x)
{
Console.WriteLine("Taxpayer #1 SSN: {0} income ${1} Tax is ${2}", socialSecurityNumber, grossIncome);
}
}
}
}