Question
Write object-oriented Swift code for the following. The unit codes of four IT units are passed into a method of a class. The units passed
Write object-oriented Swift code for the following.
The unit codes of four IT units are passed into a method of a class. The units passed in are as follows (and they are passed in this order too):
- NIT2201
- NIT2113
- NIT3114
- NIT3213
You must write Swift code that will take these four units and print for each unit the following three details:
- The number of Learning Outcomes of that unit
- The number of assessments of that unit
- The number of locations where the unit is offered.
You may search the VU website for these three details of each of the above four units.
Your output must be as follows:
where you will substitute X, Y, Z, A, B, etc. with the real figures for Learning Outcomes, assessments and locations.
You must use a loop in your code. Your code should not just be a set of printing statements that are hard-coded to just print the above four lines. Clearly just setting up a set of printing statements with the required output is not the right way to carry out this work. Looping will be part of the solution to this question.
If your solution is not object-oriented, the majority of marks will be deducted for the answer.
.l Result $swift main.swift NIT2201 has X Learning Outcomes, Y assessments and Z locations. NIT2113 has A Learning Outcomes, B assessments and C locations. NIT3114 has Z Learning Outcomes, Y assessments and X locations. NIT2113 has R Learning Outcomes, S assessments and T locations.
Step by Step Solution
3.48 Rating (148 Votes )
There are 3 Steps involved in it
Step: 1
swift import Foundation class ITUnit var unitCode Stri...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started