
I can get fare From one city to To another city and selecting One Way , AC using following code
Code
private void button1_Click(object sender, EventArgs e)Code
{Code
if (comboBox1.SelectedIndex == 0 && comboBox2.SelectedIndex == 0 && radioButton1.Checked && radioButton3.Checked)Code
{Code
MessageBox.Show("Your Fare is $225");Code
}Code
}Code
The problem is there will many many if satements incase if there are only 5 citis in combo box. What is the best way to choose different approcach to avoid if satemens.
Amit BishtRank #5,034 · 314 reputationPosted May 18, 2017, 11:37 PM EDT
Ramesh PalanivelRank #372 · 6.8K reputationPosted May 18, 2017, 11:37 PM EDT
Sulieman Alkatib66 reputationPosted May 23, 2017, 7:50 AM EDT