Professional Documents
Culture Documents
namespace ConsoleApplication11
{
class Program
{
public static void Main(string[] args)
{
double totalwage;
Student stud = new Student ("Justin", "Miranda", -89);
Worker work = new Worker ("Krystal", "Claire", 350, 8);
totalwage = work.SolveTotalWage();
}
public class Student : Human
{
private int mark;
public Student(string first_name, string last_name, int M)
:base (first_name, last_name )
{
this.mark = M;
}
public int Mark
{
get
{ return mark; }
set
{
if (value < 0)
{
Console.Write("Invalid!!");
}
else
this.mark = value;
}
}
}
public class Worker : Human
{
private int wage;
private int hours;
public Worker(string first_name, string last_name , int W, int H)
:base(first_name, last_name )
{
this.wage = W;
this.hours = H;
}
}
else
{
this.wage = value;
}
}
}
public int Hours
{
get
{
return hours;
}
set
{
if (value <= 0)
{
throw new ArgumentException();
}
else
{
this.hours = value;
}
}
}