Click here to Skip to main content
15,899,313 members
Home / Discussions / C#
   

C#

 
AnswerRe: Calling non .net cpp app functions from c# app Pin
Dimitri Witkowski21-May-10 6:44
Dimitri Witkowski21-May-10 6:44 
GeneralRe: Calling non .net cpp app functions from c# app Pin
JollyGiant196821-May-10 7:37
JollyGiant196821-May-10 7:37 
GeneralRe: Calling non .net cpp app functions from c# app Pin
Dimitri Witkowski21-May-10 7:39
Dimitri Witkowski21-May-10 7:39 
AnswerRe: Calling non .net cpp app functions from c# app Pin
Luc Pattyn21-May-10 7:23
sitebuilderLuc Pattyn21-May-10 7:23 
GeneralRe: Calling non .net cpp app functions from c# app Pin
JollyGiant196821-May-10 7:34
JollyGiant196821-May-10 7:34 
AnswerRe: Calling non .net cpp app functions from c# app Pin
David Knechtges21-May-10 7:49
David Knechtges21-May-10 7:49 
GeneralRe: Calling non .net cpp app functions from c# app Pin
Luc Pattyn21-May-10 8:07
sitebuilderLuc Pattyn21-May-10 8:07 
QuestionSending Parameter Pin
future383921-May-10 5:42
future383921-May-10 5:42 
Hi guys,
I am beginner and developing a test program.

this is the description:
Calculate the total mark and final grade:
Labs Mark is an integer from 0 to 10;
Assignmnet1 mark is an integer from 0 to 20
Assignmnet2 mark is an integer from 0 to 20
Final exam Mark is an integer from 0 to 50

Student passes the unit if and only if
• (Labs Mark + Assignment1 Mark + Assignment2 Mark)>=25 and Final exam Mark >=25

There are five grades, which should calculate as below:
• F  If the total mark is less than 40;
• MF if (40<=total Mark<50) or (total mark>=50 but student didn’t passed);
• P if (50<= total Mark <60) and student passed;
• C if (60<= total Mark <70) and student passed;
• D if (70<= total Mark <80) and student passed;
• HD if total mark >=80;





this is my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Assignmnet2
{
public class ITECH3219Student
{
//definition of Class's Field
private string FirstName;
private string SurName;
private int StudentId;
private int LabsMark;
private int Assignment1;
private int Assignment2;
private int Final;
// public string Grades;//In order to return the Student Grade.
public int TotalMark;

//defination of Class Properties
public string Fr_name
{
get { return FirstName; }
set { FirstName = value; }
}

public string Sr_Name
{
get { return SurName; }
set { SurName = value; }
}

public int St_Id
{
get { return StudentId; }
set { StudentId = value; }
}

public int Lb_Mark
{
get { return LabsMark; }
set
{
if (value > 0 && value <= 10)
{
LabsMark = value;
}
}
}

public int Ass1
{
get { return Assignment1; }
set
{
if (value > 0 && value <= 20)
{
Assignment1 = value;
}
}
}

public int Ass2
{
get { return Assignment2; }
set
{
if (value > 0 && value <= 20)
{
Assignment2 = value;
}
}
}

public int Fnl
{
get { return Final; }
set
{
if (value > 0 && value <= 50)
{
Final = value;
}
}
}

//define Constructor of Class
public ITECH3219Student(string Fr_Name, string Sr_Name, int St_Id, int Lb_Mark, int Ass1, int Ass2, int Fnl)
{
this.FirstName = Fr_Name;
this.SurName = Sr_Name;
this.StudentId = St_Id;
this.LabsMark = Lb_Mark;
this.Assignment1 = Ass1;
this.Assignment2 = Ass2;
this.Final = Fnl;
}

//define the class's methods
public bool Passed()
{
return ((LabsMark + Assignment1 + Assignment2) >= 25 && (Final >= 25));
}

public readonly string Grade()
{

}

public override string ToString()
{
return string.Format("Name:{0}\nSurname:{1}\nID:{2:D6}",
name, surname, studentID);
}


}

}



my problem is I don't know what should I write in this Part:

public readonly string Grade()
{

}

I appreciate if someone help me.

AnswerRe: Sending Parameter Pin
harold aptroot21-May-10 6:09
harold aptroot21-May-10 6:09 
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 
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 

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.