using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace test
{
public partial class
Form1 : Form
{
private double[,] table
={
{.5,.8,.6,.4,.2,.3},
{.8,.5,.4,.2,.6,.8}};
double outcome;
public Form1()
{
InitializeComponent();
comboBox1.SelectedIndex = 0; //male
comboBox2.SelectedIndex = 0; //female
}
public void chance(object sender, EventArgs e)
{
int male, female;
male = comboBox1.SelectedIndex;
female = comboBox2.SelectedIndex;
outcome = table[male, female];
label1.Text = outcome.ToString();
}
}
}
|