Question: The file DebugFour4.cs has syntax and/or logical errors. Determine the problem(s), and fix the program. my code using System; using static System.Console; class DebugFour4 {
The file DebugFour4.cs has syntax and/or logical errors. Determine the problem(s), and fix the program.
my code
using System;
using static System.Console;
class DebugFour4
{
static void Main()
{
double sales, commission;
string inputString;
const int LOWSALES = 1000;
const int MEDSALES = 5000;
const int HIGHSALES = 10000;
const double LOWPCT = 0.05;
const double MEDPCT = 0.07;
const int BONUS1 = 1000;
const int BONUS2 = 1500;
WriteLine("What was the sales amount? ");
inputString = ReadLine();
//changed inputtString to inputString
sales = Convert.ToDouble(inputString);
commission = LOWPCT * sales;
if (sales > LOWSALES && sales <= MEDSALES)
{
commission = LOWPCT * 1000;
commission += (sales - LOWSALES) * MEDPCT;
}
else if (sales > MEDSALES && sales <= HIGHSALES)
{
commission = LOWPCT * 1000;
commission += (sales - LOWSALES) * MEDPCT;
commission += BONUS1;
}
else if (sales > HIGHSALES)
{
commission = LOWPCT * 1000;
commission += (sales - LOWSALES) * MEDPCT;
commission += BONUS2;
}
WriteLine("Sales: {0} Commission: {1}", sales.ToString("C"), commission.ToString("C"));
}
}
only 87% correct
output needs to be What was the sales amount? Sales: 43,987.00 Commission: 5,559.09
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
