Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 DebugFour
static void Main
Declare and initialize variables and constants
double sales commission ; Variables for storing sales and commission amounts
string inputString; Variable for storing user input as a string
const int LOWSALES ; Lower sales threshold
const int MEDSALES ; Medium sales threshold
const int HIGHSALES ; Higher sales threshold
const double LOWPCT ; commission rate
const double MEDPCT ; commission rate
const int BONUS; $ bonus
const int BONUS; $ bonus
Prompt user for sales amount
Console.WriteLineWhat was the sales amount? ;
inputString Console.ReadLine;
sales Convert.ToDoubleinputString; Convert string input to a double
Evaluate sales amount and calculate commission
if sales LOWSALES
commission sales LOWPCT; on sales up to $
else if sales LOWSALES && sales MEDSALES
commission LOWSALES LOWPCTsales LOWSALES MEDPCT; on first $ and on amount over $ up to $
else if sales MEDSALES && sales HIGHSALES
commission LOWSALES LOWPCTMEDSALES LOWSALES MEDPCT BONUS; Additional $ bonus for sales up to $
else if sales HIGHSALES
commission LOWSALES LOWPCTMEDSALES LOWSALES MEDPCT BONUS BONUS; Additional $ bonus for sales over $
Console.WriteLineSales:
Commission: sales.ToStringC commission.ToStringC;
Console.ReadKey;
The file DebugFourcs has syntax and logical errors. Determine the problem and fix the program code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started