<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>
Hii, Im currently learning C# but I have a little bit of experience with Visual Basic language. I need to calculate the total week sales, contributions, federal tax, social security and retirement contributions.I also need to build input, display, and calculation methods for each of the deductions. My final output should display all calculated values, including the total deductions and all defined constants.
<Below this line, add a link to the EXACT exercise that you are stuck at.>
<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
Severity Code Description Project File Line Suppression State
Error CS1519 Invalid token ‘{’ in class, struct, or interface member declaration Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 52 Active
Error CS1519 Invalid token ‘+’ in class, struct, or interface member declaration Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 53 Active
Error CS1519 Invalid token ‘+’ in class, struct, or interface member declaration Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 53 Active
Error CS1519 Invalid token ‘;’ in class, struct, or interface member declaration Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 53 Active
Error CS1519 Invalid token ‘;’ in class, struct, or interface member declaration Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 53 Active
\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 57 Active
Error CS0501 ‘Program.CalculateFederalTax(double, double)’ must declare a body because it is not marked abstract, extern, or partial Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 51 Active
Error CS0100 The parameter name ‘totalBeforeDeductions’ is a duplicate Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 51 Active
Error CS0501 ‘.CalculateRetirement(double, double)’ must declare a body because it is not marked abstract, extern, or partial Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 56 Active
Error CS0246 The type or namespace name ‘totalBeforeDeductions’ could not be found (are you missing a using directive or an assembly reference?) Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 58 Active
Error CS0214 Pointers and fixed size buffers may only be used in an unsafe context Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 58 Active
Error CS0208 Cannot take the address of, get the size of, or declare a pointer to a managed type (‘totalBeforeDeductions’) Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 58 Active
Error CS0116 A namespace cannot directly contain members such as fields or methods Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 58 Active
Error CS0116 A namespace cannot directly contain members such as fields or methods Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 63 Active
Error CS0501 ‘.DisplayTotals(double, double, double, double, double, double, double)’ must declare a body because it is not marked abstract, extern, or partial Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 63 Active
Error CS0103 The name ‘CalculateRetirement’ does not exist in the current context Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 27 Active
Error CS0103 The name ‘CalculateRetirement’ does not exist in the current context Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 28 Active
Error CS0103 The name ‘DisplayTotals’ does not exist in the current context Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 29 Active
Error CS0103 The name ‘totalSalesCommission’ does not exist in the current context. Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 53 Active
Error CS0103 The name ‘totalBeforeDeductions’ does not exist in the current context. Weekly Calculator Project C:\Users\gygad\Desktop\Weekly Calculator Solution\Weekly Calculator Project\Program.cs 53 Active
```Replace this line with your code.
using System;
namespace Weekly_Calculator_Project
{
class Program
{
static void Main()
{
const double FEDERAL_TAX_RATE = .18;
const double RETIREMENT_CONTRIBUTION = .15;
const double SOCIAL_SECURITY_TAX = .09;
double totalBeforeDeductions,
totalSalesCommission,
federalTaxRate,
retirementContribution,
socialSecurityTax;
totalBeforeDeductions = GetTotal();
totalSalesCommission = CalculateSales(totalBeforeDeductions, FEDERAL_TAX_RATE);
federalTaxRate = CalculateFederalTax(totalSalesCommission, totalBeforeDeductions);
retirementContribution = CalculateRetirement(federalTaxRate, RETIREMENT_CONTRIBUTION);
socialSecurityTax = CalculateRetirement(federalTaxRate, SOCIAL_SECURITY_TAX);
DisplayTotals(totalBeforeDeductions, totalSalesCommission, retirementContribution, socialSecurityTax,
FEDERAL_TAX_RATE, RETIREMENT_CONTRIBUTION, SOCIAL_SECURITY_TAX);
Console.ReadKey();
}
static double GetTotal()
{
string inValue;
double total;
Console.Write("Please enter the total sales: ");
inValue = Console.ReadLine();
total = double.Parse(inValue);
return total;
}
static double CalculateSales(double totalBeforeDeductions, double FEDERAL_TAX_RATE)
{
return totalBeforeDeductions * FEDERAL_TAX_RATE;
}
static double CalculateFederalTax(double totalBeforeDeductions, double totalBeforeDeductions);
{
return totalSalesCommission + totalBeforeDeductions;
}
static double CalculateRetirement(double totalBeforeDeductions, double Deductions);
{
return totalBeforeDeductions* Deductions;
}
static void DisplayTotals(double totalBeforeDeductions, double totalSalesCommission,
double retirementContribution, double socialSecurityTax, double FEDERAL_TAX_RATE,
double RETIREMENT_CONTRIBUTION, double SOCIAL_SECURITY_TAX);
<do not remove the three backticks above>