Question: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Debugging { public class DebugFour 4 { static void Main ( ) { / / Declare

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Debugging
{
public class DebugFour4
{
static void Main()
{
// Declare and initialize variables and constants
double sales =0, commission =0; // Variables for storing sales and commission amounts
string inputString; // Variable for storing user input as a string
const int LOWSALES =1000; // Lower sales threshold
const int MEDSALES =5000; // Medium sales threshold
const int HIGHSALES =10000; // Higher sales threshold
const double LOWPCT =0.05; //5% commission rate
const double MEDPCT =0.07; //7% commission rate
const int BONUS1=1000; // $1,000 bonus
const int BONUS2=1500; // $1,500 bonus
// Prompt user for sales amount
Console.WriteLine("What was the sales amount? ");
inputString = Console.ReadLine();
sales = Convert.ToDouble(inputString); // Convert string input to a double
// Evaluate sales amount and calculate commission
if (sales <= LOWSALES)
commission = sales * LOWPCT; //5% on sales up to $1,000
else if (sales > LOWSALES && sales <= MEDSALES)
commission =(LOWSALES * LOWPCT)+(sales - LOWSALES)* MEDPCT; //5% on first $1,000 and 7% on amount over $1,000 up to $5,000
else if (sales > MEDSALES && sales <= HIGHSALES)
commission =(LOWSALES * LOWPCT)+(MEDSALES - LOWSALES)* MEDPCT + BONUS1; // Additional $1,000 bonus for sales up to $10,000
else if (sales > HIGHSALES)
commission =(LOWSALES * LOWPCT)+(MEDSALES - LOWSALES)* MEDPCT + BONUS1+ BONUS2; // Additional $1,500 bonus for sales over $10,000
Console.WriteLine("Sales: {0}
Commission: {1}", sales.ToString("C"), commission.ToString("C"));
Console.ReadKey();
}
}
}
The file DebugFour4.cs has syntax and logical errors. Determine the problem(, and fix the program code.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!