Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions AirportDepartures.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,37 @@ import UIKit
//: e. Use a `String?` for the Terminal, since it may not be set yet (i.e.: waiting to arrive on time)
//:
//: f. Use a class to represent a `DepartureBoard` with a list of departure flights, and the current airport



enum FlightStatus: String {
case enRoute = "En Route"
case scheduled = "Scheduled"
case canceled = "Canceled"
case delayed = "Delayed"
case boarding = "Boarding"
}

struct Airport {
var city: String
var code: String
}

struct Flight {
var departureTime: Date? = nil
var terminal: String? = nil
}

class DepartureBoard {
var FlightStatus: String
var Airport: String
var Flight: Date
var purchases: [Purchase]

init(name: String, address: String, age: Int) {
self.FlightStatus = name
self.address = address
self.age = age
self.purchases = []
}
}
//: ## 2. Create 3 flights and add them to a departure board
//: a. For the departure time, use `Date()` for the current time
//:
Expand Down