Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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):

  1. NIT2201
  2. NIT2113
  3. NIT3114
  4. NIT3213

You must write Swift code that will take these four units and print for each unit the following three details:

  1. The number of Learning Outcomes of that unit
  2. The number of assessments of that unit
  3. 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:

image

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... 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_2

Step: 3

blur-text-image_3

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Programming questions

Question

Contrast Adlers and Freuds approaches to motivation.

Answered: 1 week ago

Question

gpt 6 5 9 .

Answered: 1 week ago

Question

Describe three utility services that a DBMS should provide.

Answered: 1 week ago