ScoreCalculator/.vs/ScoreCalculator/v16/.suo
ScoreCalculator/ScoreCalculator.sln
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScoreCalculator", "ScoreCalculator\ScoreCalculator.csproj", "{8F504124-A1AB-4B5F-99D8-323091F14A27}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8F504124-A1AB-4B5F-99D8-323091F14A27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F504124-A1AB-4B5F-99D8-323091F14A27}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F504124-A1AB-4B5F-99D8-323091F14A27}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F504124-A1AB-4B5F-99D8-323091F14A27}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F7776E4A-2549-4D52-804A-B10D7EEEC9F5}
EndGlobalSection
EndGlobal
ScoreCalculator/ScoreCalculator/App.config
ScoreCalculator/ScoreCalculator/bin/Debug/ScoreCalculator.exe
ScoreCalculator/ScoreCalculator/bin/Debug/ScoreCalculator.exe.config
ScoreCalculator/ScoreCalculator/bin/Debug/ScoreCalculator.pdb
ScoreCalculator/ScoreCalculator/Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ScoreCalculator
{
public partial class Form1 : Form
{
int scoreCount = 0;
int scoreTotal = 0;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void button2_Click(object sender, EventArgs e)
{
scoreCount = 0;
scoreTotal = 0;
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
textBox5.Text = "";
}
private void button1_Click_1(object sender, EventArgs e)
{
String smarks = textBox1.Text;
int marks = Convert.ToInt32(smarks);
scoreTotal = scoreTotal + marks;
scoreCount++;
int average = scoreTotal / scoreCount;
char grade = ' ';
if ((average >= 90) && (average <= 100))
{
grade = 'A';
}
else if ((average >= 80) && (average <= 89))
{
grade = 'B';
}
else if ((average >= 70) && (average <= 79))
{
grade = 'C';
}
else if ((average >= 60) && (average <= 69))
{
grade = 'D';
}
else if ((average >= 0) && (average <= 59))
{
grade = 'F';
}
textBox2.Text = scoreTotal.ToString();
textBox3.Text = scoreCount.ToString();
textBox4.Text = average.ToString();
textBox5.Text = grade.ToString();
}
}
}
ScoreCalculator/ScoreCalculator/Form1.Designer.cs
namespace ScoreCalculator
{
partial class Form1
{
///
/// Required designer variable.
/// private System.ComponentModel.IContainer components = null;
///
/// Clean up any resources being used.
/// ///
true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// private void InitializeComponent()
{
this.label2 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.textBox5 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(179, 87);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(64, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Score total: ";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(179, 145);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(47, 13);
this.label4.TabIndex = 3;
this.label4.Text = "Average";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(179, 176);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(70, 13);
this.label5.TabIndex = 4;
this.label5.Text = "Letter grade: ";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(264, 56);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(68, 20);
this.textBox1.TabIndex = 5;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(264, 84);
this.textBox2.Name =...