This commit is contained in:
2022-11-17 14:45:04 -06:00
parent abae985418
commit 78298ae084
70 changed files with 1160 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
namespace lab7_1_CalebFontenot
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void generateButton_Click(object sender, EventArgs e)
{
// Create an array to hold the numbers.
const int SIZE = 5;
int[] lotteryNumbers = new int[SIZE];
// Create a random object.
Random rand = new Random();
// Fill the array with random numbers, in the range of 0 through 99.
for (int index = 0; index < lotteryNumbers.Length; index++)
{
lotteryNumbers[index] = rand.Next(100);
}
// Display the array elements in the Label controls.
firstLabel.Text = lotteryNumbers[0].ToString();
secondLabel.Text = lotteryNumbers[1].ToString();
thirdLabel.Text = lotteryNumbers[2].ToString();
fourthLabel.Text = lotteryNumbers[3].ToString();
fithLabel.Text = lotteryNumbers[4].ToString();
}
private void exitButton_Click(object sender, EventArgs e)
{
this.Close();
}
}
}