You are about to develop a software product that calculates semester GPA for college students. A screenshot of a sample software is given below.
The detailed requirements of the software are:Delivery
0). Before submitting your final software product, ask a classmate to test your software.
You need to provide a short description of the test and tester's name.
1). A screenshot of your final software product with test data on it (See the sample screenshot).
2). C# code
3). Put both code and screenshot into a pdf file and submit to the Bb.
Partially completed code is provided as reference. Note that the names of the graphical elements such as textbox and labels used in the code might be different from yours. Also, ... means you need to complete the missing code. Feel free to add more code if needed.
private void button1_Click(object sender, EventArgs e)
{
//Declare variables for numeric grades
double grade1;
...
//Declare variables for credit hours
double hours1;
...
double gpa = 0;
//Convert letter grades to numeric grades
grade1 = getNumericScore(textBox2.Text.ToString());
...
//Credit hours from the class names.
//Note the starting index of string characters is from 0
hours1 = Convert.ToDouble(textBox1.Text.Substring(4, 1));
...
//Weighted average GPA
gpa = ...;
//Round to two decimal places
gpa = Math.Round(gpa * 100) / 100;
//Display the GPA on a text label on the form with two decimal places
label3.Text = gpa.ToString("0.00");
}
//Given a letter, convert corresponding numeric grade
private double getNumericScore(String letterGrade)
{
double score = 0.0;
switch (letterGrade)
{
case "A":
case "a":
score = 4.0;
break;
...
case "F":
case "f":
score = 0.0;
break;
default:
MessageBox.Show("The letter grade entered is invalid");
break;
}
return score;
}