1.5 Airline Learning Activity

Airline 1.5: Update the Class Diagram to Include Return Types

Create three separate Violet files: a class diagram, a sequence diagram, and an activity diagram. Complete each diagram in its own section below. Copy the text inside the plain-text markers without typing the markers.

1.Add return types to the existing Jet operations
A Save your Airline 1.4 class diagram as 1.5

Open your Airline 1.4 class diagram and use Save As to create Airline 1.5 LastName.class.violet.html. Preserve the 1.4 file. Keep the five classes, all attributes, and the five existing associations with 1 at both ends. Do not add a Gate-to-Jet association.

B Update the two Jet operation signatures

Change + CommunicateGate() to + CommunicateGate(): string. Change + TaxiToGate(timeTaken: double) to + TaxiToGate(timeTaken: double): bool. The return type follows the closing parenthesis. Preserve the existing parameter name and type inside TaxiToGate's parentheses.

C Check the complete operation list

Airport contains + DeplaneArrival(). Jet contains + CommunicateGate(): string, + OpenCargoDoor(), and + TaxiToGate(timeTaken: double): bool. Gate contains + ConfirmArrival(gateName: string). Leave the operations compartments of Airline and Terminal empty. Keep Gate's + Name: string attribute and the other fields unchanged. Do not add return values to the void operations.

Create a Sequence Diagram Showing Returned Values
2.Read the changed method results

Use the same four participants as 1.4. In the method-body excerpts, Airplane and GateA are supplied local references to those participating objects; they do not declare new Airport fields. CommunicateGate now returns a string. During that call, the jet calls its own TaxiToGate(2.5), which returns true in this supplied scenario. The jet stores that Boolean locally and then returns "3A" to the airport. OpenCargoDoor and ConfirmArrival still return void.

Airline source to diagram
// Inside the Window event handler
CWA.DeplaneArrival();

// Body of Airport.DeplaneArrival
string gateName = Airplane.CommunicateGate();
Airplane.OpenCargoDoor();
GateA.ConfirmArrival(gateName);

// Body of Jet.CommunicateGate
bool parked = TaxiToGate(2.5);
return "3A";

// Body of Jet.TaxiToGate for this scenario
return true;
A Create the four participant lifelines

Use MainWindow : Window, CWA : Airport, Airplane : Jet, and GateA : Gate.

B Draw requests and results in their nested order

Draw DeplaneArrival() from MainWindow to CWA and CommunicateGate() from CWA to Airplane. Inside that activation draw self-call TaxiToGate(2.5). Its dashed self-return is true. Then draw dashed return "3A" from Airplane to CWA. Finish with CWA → Airplane OpenCargoDoor() and CWA → GateA ConfirmArrival("3A").

C Check that a caller receives a result before using it

The taxi result completes before the gate-name return. GateA does not send either result and receives its own confirmation call only afterward. Show no returned values for the void calls.

Create an Activity Diagram Representing an if/else Statement
3.Read the two-way luggage rule

Inside an existing method, PlaneSideCheckLuggage is Boolean. Both named operations perform their stated work and return void. The false route now does work of its own, unlike 1.4.

Airline source to diagram
if (PlaneSideCheckLuggage)
{
    OpenCargoDoor();
}
else
{
    CheckBins();
}
A Draw the two alternative actions

Start → PlaneSideCheckLuggage. The true route reaches OpenCargoDoor; false reaches CheckBins. Connect both actions directly to the same final node. Use one start, one decision, two actions, and one final node; do not add a merge diamond. Do not put one action after the other or introduce another condition for else.

B Trace each Boolean input

Each execution visits exactly one of the two actions. Both paths end after the conditional block.

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

Submit one class diagram, one sequence diagram, and one if/else activity diagram. Use Airline 1.5 LastName as the base filename, replacing LastName with your last name. The class, sequence, and activity diagram-type suffixes distinguish the three files. 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 1.5 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.