2.2 Airline Learning Activity

Airline 2.2: Create a Class Diagram Showing a One-Dimensional Gate Array

Create the requested diagrams in Violet. This is a diagramming assignment: read the supplied C# or requirements as evidence; do not submit a C# project. Each code excerpt is a focused example with its inputs and existing types explained nearby.

Copy exact diagram text from the literal spans without typing their surrounding markers. Put relationship names on connecting lines and branch conditions on arrows. The named instances help you follow identity; the values inside a box describe its current state.

1.Read the focused array model

Terminal has public field Gates of type Gate[]. Gate has public fields Number (string) and HasSkyway (bool). These method-body statements use those existing classes. Take the snapshot after every assignment has executed.

Airline source to diagram
Terminal mainTerminal = new Terminal();
mainTerminal.Gates = new Gate[3];
Gate gateA = new Gate();
gateA.Number = "3A";
gateA.HasSkyway = true;
Gate gateB = new Gate();
gateB.Number = "3B";
gateB.HasSkyway = false;
Gate gateC = new Gate();
gateC.Number = "3C";
gateC.HasSkyway = true;
mainTerminal.Gates[0] = gateA;
mainTerminal.Gates[1] = gateB;
mainTerminal.Gates[2] = gateC;
A Create the two-class array design

Draw Terminal and Gate. In Gate, enter + Number : string and + HasSkyway : bool. Leave Terminal's compartments empty and represent its field on one association labeled + Gates[]. Put 1 at Terminal and * at Gate. This course's array-role notation preserves the brackets; do not add a second Gates field inside Terminal.

Create an Object Diagram Showing the Gate Array Elements

Use the same code above and take the snapshot after every assignment has executed. Create a separate object-diagram file for the existing Terminal and its three Gate objects.

2.Show each indexed Gate reference
A Create the four-object snapshot

Draw mainTerminal : Terminal, gateA : Gate, gateB : Gate, and gateC : Gate. Populate each gate's Number and HasSkyway from the code. Inside mainTerminal add field entries Gates[0], Gates[1], and Gates[2].

B Connect each indexed field to its exact gate

Use Violet's field-reference tool: Gates[0] → gateA, Gates[1] → gateB, Gates[2] → gateC. Leave the reference-field value areas blank. For this assignment, the indexed fields are folded into the owning Terminal; do not draw a separate array container. This simplified view still represents one array with three positions.

C Check indexes, values, and identities

The valid indexes are 0–2. There are three Gate instances, four object boxes total, and three indexed reference arrows. Do not label the array field Gates[,] or use index 3.

Save and Submit
3.Save, check, and submit your diagrams
A Save the required Violet diagram files

Submit one class diagram and one object diagram. Use Airline 2.2 LastName as the base filename, replacing LastName with your last name. For multiple diagrams of the same type, add a short scenario label to distinguish them. Keep Violet's generated .violet.html extension and diagram-type suffix.

B Check scope, labels, and paths before packaging

Check every exact label, field type, direction, multiplicity, value, and reference target against this page. Open the saved files in Violet and inspect for missing connections, unreadable crossings, or clipped text.

C ZIP the saved diagram files

Put the diagram files at the ZIP root, not inside another folder. Name the archive Airline 2.2 LastName.zip. Do not include C# snippets, unrelated assignments, or instructor reference files.

D Submit the ZIP to the Feedback System

Use the matching Airline activity. Review the feedback, correct your diagrams, save, rebuild the ZIP, and resubmit as needed.

E Submit the resulting feedback URL to Canvas

Paste the resulting URL into the matching Canvas assignment. Keep your editable Violet files for later work.