|
-
March 16th, 2011, 11:28 PM
#1
Help needed creating methods
I have a question, I have a program created where I basically have a few text boxes and a button that, when clicked, calculates the averages from the test scores from the inputs in the text boxes.
My professor now wants us to create methods within our program. We are supposed to use a format of
public string variable
double (variable)
One of the things I need help creating a method for is this if structure. A method for getting the letterGrade.
if (courseAverage >= 90)
{
letterGrade = "A";
}
else if (courseAverage > 80)
{
letterGrade = "B";
}
else if (courseAverage > 70)
{
letterGrade = "C";
}
else if (courseAverage > 60)
{
letterGrade = "D";
}
else
{
letterGrade = "F";
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|