diff --git a/Sources/DemoKit/DemoKit.swift b/Sources/DemoKit/DemoKit.swift index 08b22b8..186edad 100644 --- a/Sources/DemoKit/DemoKit.swift +++ b/Sources/DemoKit/DemoKit.swift @@ -1,2 +1,20 @@ // The Swift Programming Language // https://docs.swift.org/swift-book + +/// A utility structure providing demo functionality +public struct DemoKit { + + /// Formats a greeting message + /// - Parameter name: The name to greet + /// - Returns: A formatted greeting string + public static func greet(_ name: String) -> String { + return "Hello, \(name)! Welcome to DemoKit." + } + + /// Calculates the sum of an array of integers + /// - Parameter numbers: Array of integers to sum + /// - Returns: The sum of all numbers + public static func sum(_ numbers: [Int]) -> Int { + return numbers.reduce(0, +) + } +}