Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

App Inventor

Authors: David Wolber, Hal Abelson

1st Edition

1449397484, 9781449397487

More Books

Students also viewed these Programming questions