文件名称:exam average
文件大小:40KB
文件格式:RAR
更新时间:2017-01-01 07:54:13
exam
namespace Exams_Average { public partial class examAverageForm : Form { public examAverageForm() { InitializeComponent(); } private void examAverageForm_Load(object sender, EventArgs e) { } private void exitButton_Click(object sender, EventArgs e) { Close(); } private void calculateButton_Click(object sender, EventArgs e) { // Declare variables to store the input data and the output data int examScore1, examScore2, examScore3; float examAverage; try { // Convert data in the text boxes used for input into the appropriate // data type and store in corresponding variables examScore1 = int.Parse(exam1TextBox.Text); examScore2 = int.Parse(exam2TextBox.Text); examScore3 = int.Parse(exam3TextBox.Text); // Process the input data into the output data examAverage = (examScore1 + examScore2 + examScore3) / (float)3.0; // Convert output data variables to a string and // assign the result to the proper output control averageLabel.Text = examAverage.ToString(); } catch { MessageBox.Show("Invalid Exam 1 Score", "Data Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Error); exam1TextBox.Focus(); exam1TextBox.Select(); } } private void exam2TextBox_Click(object sender, EventArgs e) { } } }
【文件预览】:
Exams Average
----Exams Average.suo(19KB)
----Exams Average.sln(881B)
----Exams Average()
--------bin()
--------Form1.Designer.cs(8KB)
--------Program.cs(515B)
--------obj()
--------Form1.cs(2KB)
--------Form1.resx(6KB)
--------Exams Average.csproj(4KB)
--------Properties()