Hello I was wondering if anyone could help me with figuring out what is wrong with my code I keep getting an error output saying at the bool for the W2 and 1099. I need to make the program ask for 3 employees names, addresses, monthly gross income and whether they have a W2 or 1099 then based on that I have to calculate the taxes for a W2 and then the subcontractor doesn't have taxes taken. If anyone could give me a couple tips I would really appreciate it heres what I have so far:
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Threading.Tasks;
- using System.Linq;
- using System.Threading;
- namespace MonthlyTaxCalculator3
- {
- class Program
- {
- static void Main(string[] args)
- {
- const double Tax_Rate = 0.07;
-
- Console.WriteLine("______________________________________________");
-
- Console.WriteLine(" Monthly Gross Income Tax Calculator: employee Name #1 ");
- Console.WriteLine("______________________________________________");
-
- Console.Write("\n Welcome Software Developers! Please enter the first name: ");
- string employeeName1 = Console.ReadLine();
-
- Console.Write("\n Please enter your address listed on file: ");
- string employeeAddress1 = Console.ReadLine();
-
- Console.Write("\n To calculate the 7% tax paid each month, please enter your annual monthly gross income: ");
- double grossIncome1 = Convert.ToDouble(Console.ReadLine());
-
- Console.Write("\n What income type are you on a W2 or subcontractor: ");
- bool incomeType1 = Convert.ToBoolean(Console.ReadLine());
-
- bool[] incomeType = {true, false};
- bool W2 = true;
- W2 = incomeType1;
- bool subcontractor = false;
- subcontractor = incomeType1;
- if (incomeType1 == W2)
- {
- double netIncomeTotal1 = CalculateGrossIncome1(grossIncome1, Tax_Rate);
- double taxesWithheld1 = CalculateTax1(grossIncome1, netIncomeTotal1);
- double netAnnualIncomeTotal1 = CalculateAnnualIncome1(grossIncome1, 12);
- double taxesWithheldAnnual1 = CalculateAnnualTax1(taxesWithheld1, 12);
-
- Console.WriteLine("\n\n Here is the annual monthly gross tax information summary: ", employeeName1);
- Console.WriteLine("\n Monthly Gross Income Before Taxes: {0:C2}", grossIncome1);
- Console.WriteLine(" Total Monthly Gross Income After Taxes Withheld: {0:C2}", taxesWithheld1);
- Console.WriteLine(" Monthly Net Income Taxes: {0:C2}", netIncomeTotal1);
- Console.WriteLine("\n Annual Yearly Gross Income Before Taxes: {0:C2}", netAnnualIncomeTotal1);
- Console.WriteLine(" Total Annual Yearly Gross Income After Taxes Withheld: {0:C2}", taxesWithheldAnnual1);
- }
- else
- {
- double netAnnualIncomeTotal1 = CalculateAnnualIncome1(grossIncome1, 12);
- Console.WriteLine("\n\n Here is the annual monthly gross tax information summary: ", employeeName1, employeeAddress1);
- Console.WriteLine("\n Annual Yearly Gross Income Before Taxes: {0:C2}", netAnnualIncomeTotal1);
- }
- Console.ReadLine();
- Console.ReadKey();
- Console.WriteLine("______________________________________________");
-
- Console.WriteLine(" Monthly Gross Income Tax Calculator: employee Name #2 ");
- Console.WriteLine("______________________________________________");
-
- Console.Write("\n Welcome Software Developers! Please enter the second name: ");
- string employeeName2 = Console.ReadLine();
-
- Console.Write("\n Please enter your address listed on file: ");
- string employeeAddress2 = Console.ReadLine();
-
- Console.Write("\n To calculate the 7% tax paid each month, please enter your annual monthly gross income: ");
- double grossIncome2 = Convert.ToDouble(Console.ReadLine());
-
- double netIncomeTotal2 = CalculateGrossIncome2(grossIncome2, Tax_Rate);
- double taxesWithheld2 = CalculateTax2(grossIncome2, netIncomeTotal2);
- double netAnnualIncomeTotal2 = CalculateAnnualIncome2(grossIncome2, 12);
- double taxesWithheldAnnual2 = CalculateAnnualTax2(taxesWithheld2, 12);
-
- Console.WriteLine("\n\n Here is the annual monthly gross tax information summary: ", employeeName2);
- Console.WriteLine("\n Monthly Gross Income Before Taxes: {0:C2}", grossIncome2);
- Console.WriteLine(" Total Monthly Gross Income After Taxes Withheld: {0:C2}", taxesWithheld2);
- Console.WriteLine(" Monthly Net Income Taxes: {0:C2}", netIncomeTotal2);
- Console.WriteLine("\n Annual Yearly Gross Income Before Taxes: {0:C2}", netAnnualIncomeTotal2);
- Console.WriteLine(" Total Annual Yearly Gross Income After Taxes Withheld: {0:C2}", taxesWithheldAnnual2);
- Console.ReadLine();
- Console.WriteLine("______________________________________________");
-
- Console.WriteLine(" Monthly Gross Income Tax Calculator: employee Name #3 ");
- Console.WriteLine("______________________________________________");
-
- Console.Write("\n Welcome Software Developers! Please enter the third name: ");
- string employeeName3 = Console.ReadLine();
-
- Console.Write("\n Please enter your address listed on file: ");
- string employeeAddress3 = Console.ReadLine();
-
- Console.Write("\n To calculate the 7% tax paid each month, please enter your annual monthly gross income: ");
- double grossIncome3 = Convert.ToDouble(Console.ReadLine());
-
- Console.WriteLine("______________________________________________");
-
- double netIncomeTotal3 = CalculateGrossIncome3(grossIncome3, Tax_Rate);
- double taxesWithheld3 = CalculateTax3(grossIncome3, netIncomeTotal3);
- double netAnnualIncomeTotal3 = CalculateAnnualIncome3(grossIncome3, 12);
- double taxesWithheldAnnual3 = CalculateAnnualTax3(taxesWithheld3, 12);
-
- Console.WriteLine("\n\n Here is the annual monthly gross tax information summary: ", employeeName3);
- Console.WriteLine("\n Monthly Gross Income Before Taxes: {0:C2}", grossIncome3);
- Console.WriteLine(" Total Monthly Gross Income After Taxes Withheld: {0:C2}", taxesWithheld3);
- Console.WriteLine(" Monthly Net Income Taxes: {0:C2}", netIncomeTotal3);
- Console.WriteLine("\n Annual Yearly Gross Income Before Taxes: {0:C2}", netAnnualIncomeTotal3);
- Console.WriteLine(" Total Annual Yearly Gross Income After Taxes Withheld: {0:C2}", taxesWithheldAnnual3);
- Console.ReadLine();
- }
- static bool incomeType1(double v)
- {
- throw new FormatException();
- }
- private static double CalculateGrossIncome1(double v)
- {
- throw new NotImplementedException();
- }
- static double CalculateGrossIncome1(double GrossIncome1, double Tax_Rate)
- {
- return GrossIncome1 * Tax_Rate;
- }
-
- private static double CalculateTax1(double v)
- {
- throw new NotImplementedException();
- }
- static double CalculateTax1(double GrossIncome1, double NetIncomeTotal1)
- {
- return GrossIncome1 - NetIncomeTotal1;
- }
- static double CalculateAnnualIncome1(double NetIncomeTotal1, double AnnualIncome1)
- {
- return NetIncomeTotal1 * 12;
- }
-
- static double CalculateAnnualTax1(double TaxesWithheld1, double TaxesWithheldAnnual1)
- {
- return TaxesWithheld1 * 12;
- }
- private static double CalculateGrossIncome2(double v)
- {
- throw new NotImplementedException();
- }
- static double CalculateGrossIncome2(double GrossIncome2, double Tax_Rate)
- {
- return GrossIncome2 * Tax_Rate;
- }
-
- private static double CalculateTax2(double v)
- {
- throw new NotImplementedException();
- }
- static double CalculateTax2(double GrossIncome2, double NetIncomeTotal2)
- {
- return GrossIncome2 - NetIncomeTotal2;
- }
- static double CalculateAnnualIncome2(double NetIncomeTotal2, double AnnualIncome2)
- {
- return NetIncomeTotal2 * 12;
- }
-
- static double CalculateAnnualTax2(double TaxesWithheldAnnual2, double TaxesWithheld2)
- {
- return TaxesWithheld2 * 12;
- }
- private static double CalculateGrossIncome3(double v)
- {
- throw new NotImplementedException();
- }
- static double CalculateGrossIncome3(double GrossIncome3, double Tax_Rate)
- {
- return GrossIncome3 * Tax_Rate;
- }
-
- private static double CalculateTax3(double v)
- {
- throw new NotImplementedException();
- }
- static double CalculateTax3(double GrossIncome3, double NetIncomeTotal3)
- {
- return GrossIncome3 - NetIncomeTotal3;
- }
- static double CalculateAnnualIncome3(double AnnualIncome3, double NetIncomeTotal3)
- {
- return NetIncomeTotal3 * 12;
- }
-
- static double CalculateAnnualTax3(double TaxesWitheld3, double TaxesWithheldAnnual3)
- {
- return TaxesWitheld3 * 12;
- }
- public override string ToString()
- {
- return base.ToString();
- }
- public override bool Equals(object obj)
- {
- return base.Equals(obj);
- }
- public override int GetHashCode()
- {
- return base.GetHashCode();
- }
- }
- }