2.1 Airline Learning Activity

Airline 2.1: Create an Activity Diagram Representing an if/else if Statement

Create three separate activity diagrams in Violet: a boarding check, gate selection, and passenger loading. For each task, learn the concept with the soccer pages, read the Airline C#, then use the exact labels and drawing instructions to build the matching activity diagram.

This assignment models simplified airline rules. Submit diagrams, not a C# project. When exact text appears in a literal span, copy only the enclosed text, without the markers or quotation marks. Use standard unlabeled start and final nodes.

First learn how C# chooses one branch, then learn how to draw the same behavior using a soccer example.

1.Prepare your Airline files
A Open Violet UML Editor and your Airline diagram folder.
B Plan three separate files with clear names identifying Airline 2.1 and each scenario.
2.Translate the Airline boarding-check code

This is a reading-and-diagramming task, not a programming submission. The following statements belong inside an existing boarding method. The Boolean inputs DigitalBoardingPass, PhysicalBoardingPass, and AirlineEmployee report which credentials the person has.

For this model, ShowPhone, ShowPass, and ShowBadge each represent showing the named credential. EnterPlane represents entering the plane, and ExitTerminal represents leaving the terminal. These supplied operations take no arguments; do not implement them for this assignment. Each credential branch calls EnterPlane after its credential action. In the diagram, combine those identical continuations into one shared Enter plane action.

Airline C# to diagram
if (DigitalBoardingPass)
{
    ShowPhone();
    EnterPlane();
}
else if (PhysicalBoardingPass)
{
    ShowPass();
    EnterPlane();
}
else if (AirlineEmployee)
{
    ShowBadge();
    EnterPlane();
}
else
{
    ExitTerminal();
}
A From the start node, go to a decision node with this exact label:

Digital boarding pass?

Label the arrow to the phone action with: true

Label the arrow to the next decision with: false

B The next decision node must use this exact label:

Physical boarding pass?

Its arrow to the pass action must be labeled: true

Its arrow to the next decision must be labeled: false

C The third decision node must use this exact label:

Airline employee?

Its arrow to the badge action must be labeled: true

Its arrow to the terminal-exit action must be labeled: false

D Create the following three credential action boxes. Copy each label exactly.

Show phone Show pass Show badge

Connect all three credential action boxes to one shared action box with this exact label, then connect it to the final node: Enter plane

E Create an action box with this exact label for the path where all three checks follow their false branches. Connect it directly to the final node. Do not connect this path to the plane-entry action.

Exit terminal

1 Verify that every decision arrow uses the exact lowercase labels shown in the plain-text markers above. The employee check happens only after both boarding-pass checks follow their false branches.
Create an Activity Diagram Representing a switch/case Statement

Learn the C# selection, then follow the soccer code-to-diagram workflow before starting Airline gate selection.

3.Translate the Airline gate-selection code

The string input AirlineName already contains exactly one of these supported names: Delta, American Airlines, or United. GoToGate takes a gate number and represents directing the passenger to that gate. This is a supplied operation; you do not implement it here.

This deliberately limited model has no default section. For an unsupported name, C# would skip every case and continue after the switch without directing the passenger. Diagram only the three supported inputs for this assignment, matching the supplied end-state diagram. Do not copy the soccer example's default route into this model.

Airline C# to diagram
switch (AirlineName)
{
    case "Delta":
        GoToGate(5);
        break;
    case "American Airlines":
        GoToGate(7);
        break;
    case "United":
        GoToGate(10);
        break;
}
A Start the process with a start node. Add a decision node using this exact label:

AirlineName?

B Create three separate outgoing arrows from the decision. Put the appropriate airline name on each arrow, using these exact labels:

Delta American Airlines United

1 The arrow labeled below must lead to an action box with the matching gate label.

Delta Go to Gate 5

2 The arrow labeled below must lead to an action box with the matching gate label.

American Airlines Go to Gate 7

3 The arrow labeled below must lead to an action box with the matching gate label.

United Go to Gate 10

C Connect all three gate action boxes to the same final node. Keep the airline paths distinct, and make sure all three reach that final node.
Create an Activity Diagram Representing a while Loop

Begin with repetition in general, then read the while syntax and the diagramming lesson. Complete the early-exit example in the diagramming lesson before drawing the full-plane route.

4.Translate the Airline passenger-loading code

PassengersRemaining is an existing nonnegative integer. PlaneFull is a supplied Boolean-returning operation: PlaneFull() checks whether all seats are occupied. AllowOnPlane represents boarding one passenger and updates the model's occupied-seat count, so a later PlaneFull() check can have a different answer. CloseDoor represents closing the door. Do not implement these operations for this diagramming task.

The statement PassengersRemaining--; means the same as PassengersRemaining = PassengersRemaining - 1;. It records one fewer waiting passenger after AllowOnPlane. The statement break; exits the loop immediately; it does not skip CloseDoor after the loop.

Airline C# to diagram
while (PassengersRemaining > 0)
{

    if (PlaneFull())
    {
        break;
    }

    AllowOnPlane();
    PassengersRemaining--;
}

CloseDoor();
A From the start node, add a decision node with this exact label:

PassengersRemaining > 0?

Label the arrow that continues to the plane-capacity decision with: while

Label the arrow that exits the loop condition with: done

B On the while path, add a second decision node with this exact label:

Plane full?

Label the full-plane arrow with: true

Label the not-full arrow with: false

The full-plane arrow leads to an action box with this label: break

The not-full arrow leads to an action box with this label: Allow on plane

Connect it to another action box labeled: PassengersRemaining--

C Connect the break action to an action box with this exact label. The done arrow from the loop-condition decision must also lead to this same action box. Connect it to the final node.

Close door

D Connect the passenger-count action back to the decision node labeled PassengersRemaining > 0? so the condition is checked again after the count decreases.
1 Verify that the loop-condition arrows are labeled with the exact while and done labels and the plane-full decision arrows are labeled with the exact true and false labels. The true path must go through break and Close door; the false path must allow one passenger on the plane, decrease the count, and return to the loop condition.
Save and Submit
5.Save and submit your work
A Save all three separate activity-diagram files: airline selection, boarding check, and passenger loading.
B Each diagram has a clear start and end, and all paths reach the correct destination.
C Check every box label and arrow label against its corresponding plain-text marker. Match spelling, capitalization, punctuation, spaces, and symbols exactly.
D Check that every action and decision path is connected and reaches its intended destination.
E Submit the three saved Violet activity-diagram files using the course submission process. If you receive feedback, correct the diagrams and resubmit them.