2.6 Airline Learning Activity [25 minutes]

Constructors in a Class Diagram
1.Read the class and constructor requirements [20 minutes]

Create the requested diagrams in Violet. This is a diagramming assignment: use the written requirements as evidence; do not submit a C# project.

Copy exact diagram text from the literal spans without typing their surrounding markers. Put relationship names on connecting lines and branch conditions on arrows.

Use the following declarations as the source for the class members. Jet is an existing type used only by the Gate constructor parameter in this diagram; do not add a Jet class or a plane association. The passenger-list field is represented by its association line. The constructor parameter plane is not stored as Gate state.

Classes to represent
using System.Collections.Generic;

public class Gate
{
    private string number;
    private bool hasSkyway;
    private List<Passenger> passengers;

    public Gate(bool hasSkyway, string number, Jet plane)
    {
        this.number = number;
        this.hasSkyway = hasSkyway;
    }

    public void ConfirmArrival(string gateName)
    {
    }

    private void CheckLuggage()
    {
    }
}

public class Passenger
{
    private string name;

    public Passenger(string name)
    {
        this.name = name;
    }
}
A Update the Gate and Passenger class boxes

In Gate, write - number: string and - hasSkyway: bool in the attributes compartment. In its operations compartment, enter + Gate(hasSkyway: bool, number: string, plane: Jet), + ConfirmArrival(gateName: string), and - CheckLuggage(). In Passenger, write - name: string and + Passenger(name: string). Keep every parameter in the shown order and do not add return types.

B Represent the passenger-list association

Draw Gate → Passenger labeled - passengers. Put 1 at the Gate endpoint and * at the Passenger endpoint. This association represents Gate's private passenger list. The plane : Jet constructor parameter is not a stored field or association in this diagram.

C Use a concrete call to check the contract

The call new Gate(true, "3A", spirit) matches the Gate constructor parameter order when spirit is a non-null Jet reference. Keep actual argument values out of the class signature. The plane parameter appears in the constructor signature only; the supplied diagram does not show it as stored Gate state. No object or sequence diagram is required.

Save and Submit
2.Save, check, and submit your diagrams [5 minutes]
A Save the required Violet diagram files

Submit one class diagram. Use Airline 2.6 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.6 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.