|
-
February 15th, 2012, 01:25 AM
#1
Newb question. I am just begining to use C#
Hello guys,
I am just starting to use C# for school. I like the program so far but I have lots to learn. I am having problems with properties. This is an assignment for school but I don't know how to do it.
I need to know how to code the properties.
This is the code so far:
namespace Assignment2
{
public class Student
{
public Student(string n)
{
Name = n;
Record = new Transcript();
}
// To do: Property implementation
public string Name;
public Transcript Record;
public double GPA
{
get
{
return Record.GPA;
}
}
public int WealthPoints = 10000;
public int PridePoints = 100;
}
}
then I'm given a table to add some properties?
this is what the table looks like:
Student
-m_record : Transcript
-m_name : string
-m_wealth : int = 1000
-m_pride : int = 100
+ Student(string);
+Name : string
+WealthPoints : int
+PridePoints : int
+GPA : double
+Record: Transcript
Any advice would be really helpful. Thanks.
I am using Visual C# 2010 Express
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
|