2.6 Airline Learning Activity

Airline 2.6: Constructors in a Class Diagram

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 how a Gate receives its initial state

Jet is an existing class with public string field Name. For this focused model, every Gate creation supplies a non-null Jet. The source assumes that valid input rather than adding exception handling. The constructor stores the supplied reference; it does not create another jet.

Airline source to diagram
public class Gate
{
    private bool hasSkyway;
    private string number;
    private Jet plane;

    public Gate(bool hasSkyway, string number, Jet plane)
    {
        this.hasSkyway = hasSkyway;
        this.number = number;
        this.plane = plane;
    }
}
A Create Gate and Jet class boxes

In Gate write - hasSkyway : bool and - number : string. In its operation compartment write + Gate(hasSkyway : bool, number : string, plane : Jet). Jet contains + Name : string. Keep the constructor's input order exactly as shown.

B Show the stored Jet field separately from the input parameter

Draw Gate → Jet labeled - plane with 1 at the Jet endpoint for this valid constructed-object model. The parameter plane : Jet belongs inside the constructor parentheses; the association represents the field that retains the reference afterward. These are not two separate jets.

C Use a concrete call to check the contract

The call new Gate(true, "3A", spirit) matches the parameter order when spirit is a non-null Jet reference. Keep those actual argument values out of the class signature. No object or sequence diagram is required.

Save and Submit
2.Save, check, and submit your diagrams
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.