Click here to Skip to main content
15,914,500 members
Home / Discussions / C#
   

C#

 
GeneralRe: Sending Parameter Pin
future383921-May-10 6:13
future383921-May-10 6:13 
GeneralRe: Sending Parameter Pin
harold aptroot21-May-10 6:21
harold aptroot21-May-10 6:21 
GeneralRe: Sending Parameter Pin
William Winner21-May-10 7:01
William Winner21-May-10 7:01 
GeneralRe: Sending Parameter Pin
harold aptroot21-May-10 7:10
harold aptroot21-May-10 7:10 
GeneralRe: Sending Parameter Pin
William Winner21-May-10 7:25
William Winner21-May-10 7:25 
GeneralRe: Sending Parameter Pin
harold aptroot21-May-10 7:27
harold aptroot21-May-10 7:27 
GeneralRe: Sending Parameter Pin
harold aptroot21-May-10 7:24
harold aptroot21-May-10 7:24 
AnswerRe: Sending Parameter Pin
William Winner21-May-10 7:19
William Winner21-May-10 7:19 
Like the other responder said,
C#
public readonly string Grade()
is not the normal way to write a read-only property if that is what you're trying to do.

It should be
C#
public string Grade
{
    get
    {
        //put your code here
    }
}


So, now you just need to test the scores to determine the grade...this isn't that complicated. Just go in order of what your prof gave you.

C#
int totalMark = LabsMark + Assignment1 + Assignment2 + Final;

//Test if less than 40
if (totalMark < 40)
{
  return "F";
}
else if (!Passed())
{
  //if you get here, then they scored over 40
  //if they scored less than 50, then they didn't pass anyway
  //so you don't need to check that case
  return "MF";
}
else if (totalMark < 60)
{
  return "P";
}
// more else if statements to test the rest


it's true that you don't need the else if's, but it makes the code a lot more readable.
Questionhow to develop OPC Client using C# Pin
Raghu_M21-May-10 5:19
Raghu_M21-May-10 5:19 
QuestionBest Practices: Checking For Null Objects After Initializing Pin
Wainwrightwt21-May-10 3:24
Wainwrightwt21-May-10 3:24 
AnswerRe: Best Practices: Checking For Null Objects After Initializing Pin
PIEBALDconsult21-May-10 3:35
mvePIEBALDconsult21-May-10 3:35 
AnswerRe: Best Practices: Checking For Null Objects After Initializing Pin
harold aptroot21-May-10 3:36
harold aptroot21-May-10 3:36 
AnswerRe: Best Practices: Checking For Null Objects After Initializing Pin
Luc Pattyn21-May-10 3:44
sitebuilderLuc Pattyn21-May-10 3:44 
GeneralRe: Best Practices: Checking For Null Objects After Initializing Pin
PIEBALDconsult21-May-10 3:52
mvePIEBALDconsult21-May-10 3:52 
GeneralRe: Best Practices: Checking For Null Objects After Initializing Pin
Md. Marufuzzaman21-May-10 4:53
professionalMd. Marufuzzaman21-May-10 4:53 
GeneralRe: Best Practices: Checking For Null Objects After Initializing Pin
Md. Marufuzzaman21-May-10 4:55
professionalMd. Marufuzzaman21-May-10 4:55 
AnswerRe: Best Practices: Checking For Null Objects After Initializing Pin
Covean21-May-10 3:51
Covean21-May-10 3:51 
GeneralRe: Best Practices: Checking For Null Objects After Initializing Pin
Wainwrightwt21-May-10 4:16
Wainwrightwt21-May-10 4:16 
GeneralRe: Best Practices: Checking For Null Objects After Initializing Pin
Covean21-May-10 4:27
Covean21-May-10 4:27 
GeneralRe: Best Practices: Checking For Null Objects After Initializing Pin
Luc Pattyn21-May-10 4:42
sitebuilderLuc Pattyn21-May-10 4:42 
GeneralRe: Best Practices: Checking For Null Objects After Initializing Pin
Wainwrightwt21-May-10 5:22
Wainwrightwt21-May-10 5:22 
QuestionMultiple forms in C# Pin
Etienne_12321-May-10 2:26
Etienne_12321-May-10 2:26 
AnswerRe: Multiple forms in C# Pin
#realJSOP21-May-10 2:30
professional#realJSOP21-May-10 2:30 
AnswerRe: Multiple forms in C# Pin
Luc Pattyn21-May-10 3:45
sitebuilderLuc Pattyn21-May-10 3:45 
AnswerRe: Multiple forms in C# Pin
PIEBALDconsult21-May-10 4:33
mvePIEBALDconsult21-May-10 4:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.