Question: Use pass task 3 to solve pass task 7 and 8 Pass task 3 Code: Units: public class Unit { private string _code; private string

Use pass task 3 to solve pass task 7 and 8

Pass task 3 Code:

Units:

public class Unit { private string _code; private string _name; private AssesmentType _type; private Teaching Mode _mode; private string[] _prerequisites;

/// /// constructor /// /// /// /// /// /// public Unit(string code, string name, AssesmentType type, Teaching Mode, string[] prerequisites) { _code = code; _name = name; _type = type; _mode = mode; _prerequisites = prerequisites; }

public string Code { get { return _code; } } public string Name { get { return _name; } } public AssesmentType Type { get { return _type; } } public Teaching Mode { get { return _mode; } } public string[] Prerequisites { get { return _prerequisites; } } /// /// /// /// a message depending on the assessment type public string InformUnitDetails() { if (_type == AssesmentType. Portfolio) { return \"Get ready with a lot of hands-on for this semester\"; } else if (_type == AssesmentType.FinalExamBased) { return \"Get ready with quizzes and tests\"; } else { return \"Invalid category\"; } } }

AssesmentType.cs:

public enema AssesmentType { Portfolio, FinalExamBased } TeachingMode.cs:

public enema Teaching Mode { F2F, Online, Blended } Programs:

public class Program { static void Main(string[] args) { // Add an array of 2 units to Main Unit[] units = new Unit[2]; // Initialize the array with 2 new Unit objects units[0] = new Unit(\"COS20007\", \"OOP\", AssesmentType. Portfolio, TeachingMode.Blended, new string[] { \"COS10009\" }); units[1] = new Unit(\"COS30019\", \"AI\", AssesmentType.FinalExamBased, TeachingMode.F2F, new string[] { \"COS20007\", \"COS30008\" });

// Use Display Info to execute all of the units Display Info(units); }

/// /// Displays the units information and result of InformUnitDetails /// /// static void Display Info(Unit[] units) { // iterate through the array and display the units info for (int index = 0; index { Console.WriteLine(units[index].Code + \"|\" + units[index].Mode + \"|\" + units[index].Type); Console.WriteLine(units[index].InformUnitDetails()); Console.WriteLine(); } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!