-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask3_Program.cs
More file actions
41 lines (31 loc) · 1.11 KB
/
Task3_Program.cs
File metadata and controls
41 lines (31 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Task3
{
class Program
{
static void Main(string[] args)
{
var people = new List<Person>();
string[] subjects = { "Math", "Science", "English" };
string studentName = "Sue";
//TODO: 6, instantiate student and add to people collection
Student myStudent = new Student(studentName, subjects);
people.Add(myStudent);
string faculty = "Computer Science";
string teacherName = "Tim";
//TODO: 7, instantiate teacher and add to people collection
Teacher myTeacher = new Teacher(teacherName, faculty);
people.Add(myTeacher);
//TODO: 8, iterate through people collection and invoke PrintDetails for each element
foreach (var person in people)
{
person.PrintDetails();
}
Console.ReadKey();
}
}
}