|
-
March 10th, 2011, 12:10 PM
#5
Re: Please help very basic :)
 Originally Posted by imrbrett
thanks for the reply
to confirm what you mean about setting the value are you saying this....
public string Grade
{
get
{
return grade;
}
}
should be changed to this...???
public string Grade
{
get
{
return grade;
}
set
{
grade = value;
}
}
and are you also saying instead of having:
Console.WriteLine("Grade: ", myTest.Grade)
it should be:
Console.WriteLine("Grade: {0}", myTest.Grade);
just wanna make sure i understand clearly what is needed thanks!
Ehhh... not quite. Just adding a set accessor to the Grade property isn't going to solve your problem You still need to determine the grade letter using the average you get from a call to DetermineAverage(). Your SetGrade() method does a good job of converting the average to a letter grade, so stick with that.
Just call the SetGrade() method and pass in the test average after you call DetermineAverage() and you should be set.
As for the Console.Writeline() stuff, yes... just like that Also, you may want to check how out to use code tags. Check out this thread: http://www.codeguru.com/forum/showthread.php?t=401115
Last edited by RaleTheBlade; March 10th, 2011 at 12:13 PM.
R.I.P. 3.5" Floppy Drives
"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." - Albert Einstein
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
|