Hi guys! 1st post here, I hope i do it correctly!
Anyway, I am trying to answer this question:
Define a class Tutor, which inherits the Person class. Tutor should represent a tutor who teaches one or more modules at Bedfordshire University. A Tutor should have a few extra properties in addition to those inherited from Person, such as an office location (as a string), a list of course taught, (array of string) and any others. Write out C# code for this class showing inheritance relationship, the new data fields and a set of C# properties for setting and getting their values
using this code [I haven't done the array's yet]
Code:
using System;
using System.Collections.Generic;
using System.Text;
namespace Tutor
{
public class Person
{
private string name;
private string age;
public Person ()
{
name = "" ;
age = "";
}
public Person (string n, string a)
{
this.name = n;
age = a;
}
public string PrintDescription ()
{
return "Name " + n + "Age:" + a;
}
}
public class Student : Person
{
private string university;
private string id;
private string officeLocation;
public void Main (string [] arg);
public Student()
{
university = "";
id = "";
officeLocation = "";
}
public Student (string n, string a, string u, string id, string ol)
{
this.name = n;
age = a;
university = u;
id = id;
officeLocation = ol;
}
public string PrintDescription2 ()
{
return "University: " + u + "ID: " + id + "Office Location: " + ol;
}
static void Main(string[] args)
{
Person x = new Person("Takeshi Kitano", "49");
Student y = new Student("Luton", "0519900", "D-Block 2345");
Console.WriteLine(x.Person);
Console.WriteLine(y.Student);
Console.Read();
}
}
}
But I keep getting this message:
http://xs208.xs.to/xs208/06423/untitled1212.JPG
Any help on the issue? Thanks in advance for the help!!!