I haven't a living clue how to write this in c#. I know how to do it in Delphi.
This is how I would do it in Delphi:
Case Total of
80..100 : ShowMessage ('You got an A!');
60..79 : ShowMessage ('You got a B!');
50..59 : ShowMessage ('You got a C!');
40..49 : ShowMessage ('You got a D!');
0..39 : ShowMessage ('You got an E...');
end;
I have read tutorials for this, but I wouldn't know how to use/write it in the way I need it.
Here's my version in c#:
switch (Total) //'Total' is a bunch of Integers divided together to get a Percentage
{
case 80..100: //Where 80% to 100% would achieve an A
{
MessageBox.Show("You got an A!");
}
case 60..79: //Where 60% to 79% would achieve a B
{
MessageBox.Show("You got a B!");
}
Is this possible?
Thanks.