Вопрос C# для VS 2015. Как реализовать if else if
Я делаю простую программу, которая является классным заданием. Я не могу понять,как обернуть код.
Что я уже пробовал:
public partial class frmPetClinic : Form { public frmPetClinic() { InitializeComponent(); // Delcare varibles. Boolean bolFleaTreatment; Boolean bolHairTrim; Boolean bolNailTrim; Boolean bolDematting; Boolean bolHeartwormTreatmen; Boolean bolHepatitisVaccine; Boolean bolDistemperVaccine; Boolean bolRabiesVaccine; double dblCost; bolFleaTreatment = chkFleaTreatment.Checked; bolHairTrim = chkHairTrim.Checked; bolNailTrim = chkNailTrim.Checked; bolDematting = chkDematting.Checked; bolHeartwormTreatmen = chkHeartwormTreatment.Checked; bolHepatitisVaccine = chkHepatitisVaccine.Checked; bolDistemperVaccine = chkDistemperVaccine.Checked; bolRabiesVaccine = chkRabiesVaccine.Checked; dblCost = 0; } private void btnExit_Click(object sender, EventArgs e) { //Exit the app. Application.Exit(); } private void btnClear_Click(object sender, EventArgs e) { //Clear selected checkboxes. //Clear running total. chkFleaTreatment.Checked = false; chkHairTrim.Checked = false; chkNailTrim.Checked = false; chkDematting.Checked = false; chkHeartwormTreatment.Checked = false; chkHepatitisVaccine.Checked = false; chkDistemperVaccine.Checked = false; chkRabiesVaccine.Checked = false; lblCost.Text = string.Empty; } private void chkFleaTreatment_CheckedChanged(object sender, EventArgs e) { // Decide which if any checkboxes are checked. // Add total costs and convert to currency // If box is unchecked, deduct price from cost if (true) else } } }