2.4 Airline Learning Activity

Create the class diagram

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.

1.Model the following class definitions
Classes to represent
using System.Collections.Generic;

public class Gate
{
    public List<Passenger> Passengers;
}

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

Create Gate on the left and Passenger on the right. In Passenger's attributes compartment, enter + Name : string. Leave Gate's attributes compartment and both methods compartments empty.

B Represent the passenger list on the relationship

Connect Gate to Passenger with an association arrow pointing toward Passenger. Put + Passengers<Passenger> on the relationship line, 1 at the Gate end, and * at the Passenger end.

C Check the class design

Verify that there are two classes and one association. Keep Passengers on the relationship line rather than also adding it inside Gate. Check the arrow direction, labels, and multiplicities.

Create the object diagram
2.Show a gate with three passengers

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

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

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

Keep your editable Violet files for later work.