Monday, October 27, 2014

i cant figure out the last little bit of this problem.



i cant seem to run the program. any help?



private void button1_Click(object sender, EventArgs e)
{
double numOfItems = double.Parse(textBox1.Text);
double numOfPounds = double.Parse(textBox1.Text);

bool surchargeApplicable = true;

string shippingMethod = "SSM";
double surcharge;

switch (shippingMethod)
{
case "SSM":
surcharge = 2.5;
break;
case "ESM":
surcharge = 5;
break;
case "SDM":
surcharge = 8;
break;
}
double finalAmount;
double itemsAmount = 10;


//Calculate Items amount
finalAmount = itemsAmount;
if (surchargeApplicable)
{
finalAmount = itemsAmount + surcharge;
}
finalAmount = finalAmount * numOfItems;

//calculate Pounds amount
double poundsAmount = 10;
finalAmount = poundsAmount;
if (surchargeApplicable)
{
finalAmount = poundsAmount + surcharge;
}
finalAmount = finalAmount * numOfPounds;

label7.Text = finalAmount.ToString;

}

private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
string shippingMethod = comboBox2.Text;
}





Lyndsee Elizabeth



No comments:

Post a Comment