2.4 Airline Learning Activity [50 minutes]

Create the class diagram
1.Model the supplied class design [15 minutes]

Create one class diagram and one object diagram in Violet. Use the same Passengers list in both diagrams. Copy exact diagram text from the plain-text markers without typing the markers.

Use the following declarations as the source for the class members. Represent Passengers as an association from Gate to Passenger, not as an attribute inside Gate.

Classes to represent
using System.Collections.Generic;

public class Gate
{
    public string Number;
    public bool HasSkyway;
    public List<Passenger> Passengers;

    public void ConfirmArrival(string gateName)
    {
    }

    public void CheckLuggage()
    {
    }
}

public class Passenger
{
    public string Name;
}
A Add the Gate and Passenger classes

Create Gate on the left and Passenger on the right. In Gate's attributes compartment, enter + Number: string and + HasSkyway: bool. In its operations compartment, enter + ConfirmArrival(gateName: string) and + CheckLuggage(). In Passenger's attributes compartment, enter + Name: string. Leave both classes' unlisted compartments empty.

B Represent the passenger list on the relationship

Connect Gate to Passenger with an association arrow pointing toward Passenger. Put + Passengers on the relationship line, 1 at the Gate end, and * at the Passenger end. Do not duplicate Passengers inside either class.

C Check the class design

Verify that Gate has the two public fields and two public operations, and Passenger has the public Name field. Keep + Passengers on the relationship line rather than adding it inside Gate. Check the arrow direction, labels, and multiplicities.

Create the object diagram
2.Show a gate with three passengers [15 minutes]

Model one Gate object whose Passengers list contains three distinct Passenger objects. Their names are Johnson, Xiong, and Smith.

A Add the gate and its list field

Create an object headed GateA : Gate on the left. Inside it, add one field named Passengers. Leave the field's value area blank so you can connect references from it.

B Add the three Passenger objects

Create three separate objects on the right, each headed Passenger. Inside each object, add a field named Name. Enter Johnson in the top object's value area, Xiong in the middle object's value area, and Smith in the bottom object's value area. Enter the values without quotation marks.

C Connect the list field to all three passengers

Use Violet's object-reference tool to draw three arrows from the same Passengers field in GateA : Gate. Connect one arrow to each Passenger object, with the arrowheads pointing toward the passengers.

D Check the objects, values, and references

Verify that all three passenger headings are Passenger, each passenger has its own Name value, and all three arrows begin at the gate's Passengers field. Keep the text readable and the arrows separated.

Save and submit
3.Save and review both diagrams [10 minutes]

Use Airline 2.4 LastName as the base filename, replacing LastName with your last name. Keep Violet's diagram-type suffix and .violet.html extension. Open each saved file and check its labels, values, connections, and readability.

A Package the two Violet files

Place the class and object diagram files at the ZIP root. Name the archive Airline 2.4 LastName.zip.

4.Submit the ZIP to the matching Airline activity in the Feedback System [5 minutes]

Review the feedback, correct your diagrams, save, rebuild the ZIP, and resubmit as needed.

5.Submit the resulting feedback URL to the matching Canvas assignment [5 minutes]

Keep your editable Violet files for later work.