From 753d1774b7ccc2f7d7310cb462d440c388997d81 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 20 Dec 2022 10:10:56 +0900 Subject: [PATCH] =?UTF-8?q?Chore:=20PR=20=EC=97=B0=EC=8A=B5=EC=9D=84=20?= =?UTF-8?q?=EC=9C=84=ED=95=9C=20=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8=20?= =?UTF-8?q?=EB=B3=B5=EC=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 363 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcdebugger/Breakpoints_v2.xcbkptlist | 6 + .../xcschemes/xcschememanagement.plist | 14 + .../Error/DataError.swift | 12 + .../Model/DataTable.swift | 20 + .../Model/Enum/ExecuteMenu.swift | 19 + .../Model/Enum/Grade.swift | 46 +++ .../Model/Process.swift | 131 +++++++ .../Model/Protocol/SystemMenu.swift | 73 ++++ .../View/PrintMessage.swift | 84 ++++ .../MyCreditManager_jasonLee0223/main.swift | 49 +++ 13 files changed, 832 insertions(+) create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/project.pbxproj create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/xcuserdata/kh_lee.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/xcuserdata/kh_lee.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Error/DataError.swift create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/DataTable.swift create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Enum/ExecuteMenu.swift create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Enum/Grade.swift create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Process.swift create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Protocol/SystemMenu.swift create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/View/PrintMessage.swift create mode 100644 MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/main.swift diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/project.pbxproj b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f62863d --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/project.pbxproj @@ -0,0 +1,363 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 5B05E9AA293ED679008C1AB2 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B05E9A9293ED679008C1AB2 /* main.swift */; }; + 5B05E9B2293ED7A2008C1AB2 /* ExecuteMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B05E9B1293ED7A2008C1AB2 /* ExecuteMenu.swift */; }; + 5B05E9B4293ED876008C1AB2 /* PrintMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B05E9B3293ED876008C1AB2 /* PrintMessage.swift */; }; + 5B05E9B6293ED899008C1AB2 /* Process.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B05E9B5293ED899008C1AB2 /* Process.swift */; }; + 5B05E9B9293ED8C6008C1AB2 /* SystemMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B05E9B8293ED8C6008C1AB2 /* SystemMenu.swift */; }; + 5B05E9BC2940D8F7008C1AB2 /* DataError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B05E9BB2940D8F7008C1AB2 /* DataError.swift */; }; + 5B05E9C12941A0EA008C1AB2 /* Grade.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B05E9C02941A0EA008C1AB2 /* Grade.swift */; }; + 5BD54003293F09E900BC0C33 /* DataTable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BD54002293F09E900BC0C33 /* DataTable.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 5B05E9A4293ED679008C1AB2 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 5B05E9A6293ED679008C1AB2 /* MyCreditManager_jasonLee0223 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = MyCreditManager_jasonLee0223; sourceTree = BUILT_PRODUCTS_DIR; }; + 5B05E9A9293ED679008C1AB2 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; + 5B05E9B1293ED7A2008C1AB2 /* ExecuteMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExecuteMenu.swift; sourceTree = ""; }; + 5B05E9B3293ED876008C1AB2 /* PrintMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrintMessage.swift; sourceTree = ""; }; + 5B05E9B5293ED899008C1AB2 /* Process.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Process.swift; sourceTree = ""; }; + 5B05E9B8293ED8C6008C1AB2 /* SystemMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemMenu.swift; sourceTree = ""; }; + 5B05E9BB2940D8F7008C1AB2 /* DataError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataError.swift; sourceTree = ""; }; + 5B05E9C02941A0EA008C1AB2 /* Grade.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Grade.swift; sourceTree = ""; }; + 5BD54002293F09E900BC0C33 /* DataTable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataTable.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 5B05E9A3293ED679008C1AB2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 5B05E99D293ED679008C1AB2 = { + isa = PBXGroup; + children = ( + 5B05E9A8293ED679008C1AB2 /* MyCreditManager_jasonLee0223 */, + 5B05E9A7293ED679008C1AB2 /* Products */, + ); + sourceTree = ""; + }; + 5B05E9A7293ED679008C1AB2 /* Products */ = { + isa = PBXGroup; + children = ( + 5B05E9A6293ED679008C1AB2 /* MyCreditManager_jasonLee0223 */, + ); + name = Products; + sourceTree = ""; + }; + 5B05E9A8293ED679008C1AB2 /* MyCreditManager_jasonLee0223 */ = { + isa = PBXGroup; + children = ( + 5B05E9BE2941A043008C1AB2 /* Error */, + 5B05E9BD2941A01F008C1AB2 /* View */, + 5B05E9B0293ED794008C1AB2 /* Model */, + 5B05E9A9293ED679008C1AB2 /* main.swift */, + ); + path = MyCreditManager_jasonLee0223; + sourceTree = ""; + }; + 5B05E9B0293ED794008C1AB2 /* Model */ = { + isa = PBXGroup; + children = ( + 5B05E9B7293ED8B8008C1AB2 /* Protocol */, + 5B05E9BF2941A066008C1AB2 /* Enum */, + 5B05E9B5293ED899008C1AB2 /* Process.swift */, + 5BD54002293F09E900BC0C33 /* DataTable.swift */, + ); + path = Model; + sourceTree = ""; + }; + 5B05E9B7293ED8B8008C1AB2 /* Protocol */ = { + isa = PBXGroup; + children = ( + 5B05E9B8293ED8C6008C1AB2 /* SystemMenu.swift */, + ); + path = Protocol; + sourceTree = ""; + }; + 5B05E9BD2941A01F008C1AB2 /* View */ = { + isa = PBXGroup; + children = ( + 5B05E9B3293ED876008C1AB2 /* PrintMessage.swift */, + ); + path = View; + sourceTree = ""; + }; + 5B05E9BE2941A043008C1AB2 /* Error */ = { + isa = PBXGroup; + children = ( + 5B05E9BB2940D8F7008C1AB2 /* DataError.swift */, + ); + path = Error; + sourceTree = ""; + }; + 5B05E9BF2941A066008C1AB2 /* Enum */ = { + isa = PBXGroup; + children = ( + 5B05E9B1293ED7A2008C1AB2 /* ExecuteMenu.swift */, + 5B05E9C02941A0EA008C1AB2 /* Grade.swift */, + ); + path = Enum; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 5B05E9A5293ED679008C1AB2 /* MyCreditManager_jasonLee0223 */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5B05E9AD293ED679008C1AB2 /* Build configuration list for PBXNativeTarget "MyCreditManager_jasonLee0223" */; + buildPhases = ( + 5B05E9A2293ED679008C1AB2 /* Sources */, + 5B05E9A3293ED679008C1AB2 /* Frameworks */, + 5B05E9A4293ED679008C1AB2 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MyCreditManager_jasonLee0223; + productName = MyCreditManager_jasonLee0223; + productReference = 5B05E9A6293ED679008C1AB2 /* MyCreditManager_jasonLee0223 */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 5B05E99E293ED679008C1AB2 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1400; + LastUpgradeCheck = 1410; + TargetAttributes = { + 5B05E9A5293ED679008C1AB2 = { + CreatedOnToolsVersion = 14.0.1; + }; + }; + }; + buildConfigurationList = 5B05E9A1293ED679008C1AB2 /* Build configuration list for PBXProject "MyCreditManager_jasonLee0223" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 5B05E99D293ED679008C1AB2; + productRefGroup = 5B05E9A7293ED679008C1AB2 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 5B05E9A5293ED679008C1AB2 /* MyCreditManager_jasonLee0223 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 5B05E9A2293ED679008C1AB2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5B05E9B2293ED7A2008C1AB2 /* ExecuteMenu.swift in Sources */, + 5B05E9C12941A0EA008C1AB2 /* Grade.swift in Sources */, + 5B05E9B4293ED876008C1AB2 /* PrintMessage.swift in Sources */, + 5BD54003293F09E900BC0C33 /* DataTable.swift in Sources */, + 5B05E9AA293ED679008C1AB2 /* main.swift in Sources */, + 5B05E9BC2940D8F7008C1AB2 /* DataError.swift in Sources */, + 5B05E9B6293ED899008C1AB2 /* Process.swift in Sources */, + 5B05E9B9293ED8C6008C1AB2 /* SystemMenu.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 5B05E9AB293ED679008C1AB2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 12.3; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 5B05E9AC293ED679008C1AB2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 12.3; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 5B05E9AE293ED679008C1AB2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Automatic; + DEAD_CODE_STRIPPING = YES; + DEVELOPMENT_TEAM = LSMZ653R3K; + ENABLE_HARDENED_RUNTIME = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 5B05E9AF293ED679008C1AB2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Automatic; + DEAD_CODE_STRIPPING = YES; + DEVELOPMENT_TEAM = LSMZ653R3K; + ENABLE_HARDENED_RUNTIME = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 5B05E9A1293ED679008C1AB2 /* Build configuration list for PBXProject "MyCreditManager_jasonLee0223" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5B05E9AB293ED679008C1AB2 /* Debug */, + 5B05E9AC293ED679008C1AB2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5B05E9AD293ED679008C1AB2 /* Build configuration list for PBXNativeTarget "MyCreditManager_jasonLee0223" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5B05E9AE293ED679008C1AB2 /* Debug */, + 5B05E9AF293ED679008C1AB2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 5B05E99E293ED679008C1AB2 /* Project object */; +} diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/xcuserdata/kh_lee.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/xcuserdata/kh_lee.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..3b5a8bc --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/xcuserdata/kh_lee.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,6 @@ + + + diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/xcuserdata/kh_lee.xcuserdatad/xcschemes/xcschememanagement.plist b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/xcuserdata/kh_lee.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..668cdb3 --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223.xcodeproj/xcuserdata/kh_lee.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + MyCreditManager_jasonLee0223.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Error/DataError.swift b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Error/DataError.swift new file mode 100644 index 0000000..1aa6922 --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Error/DataError.swift @@ -0,0 +1,12 @@ +// +// DataError.swift +// MyCreditManager_jasonLee0223 +// +// Created by Jason on 2022/12/07. +// + +import Foundation + +enum DataError: Error { + case invalidUserInputSingle(Value: String) +} diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/DataTable.swift b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/DataTable.swift new file mode 100644 index 0000000..0ea0fa7 --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/DataTable.swift @@ -0,0 +1,20 @@ +// +// DataTable.swift +// MyCreditManager_jasonLee0223 +// +// Created by 이건행 on 2022/12/06. +// + +import Foundation + +struct DataTable: Equatable { + var name: String + var subject: String + var grade: Grade + + init(name: String, subject: String, grade: Grade) { + self.name = name + self.subject = subject + self.grade = grade + } +} diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Enum/ExecuteMenu.swift b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Enum/ExecuteMenu.swift new file mode 100644 index 0000000..4bd7525 --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Enum/ExecuteMenu.swift @@ -0,0 +1,19 @@ +// +// ExecuteMenu.swift +// MyCreditManager_jasonLee0223 +// +// Created by Jason on 2022/12/06. +// + +import Foundation + +extension MyCreditManager { + enum ExecuteMenu: String { + case addStudent = "1" + case deleteStudent = "2" + case addOrChangeToGrade = "3" + case deleteGrade = "4" + case averageView = "5" + case exitCommand = "X" + } +} diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Enum/Grade.swift b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Enum/Grade.swift new file mode 100644 index 0000000..871d711 --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Enum/Grade.swift @@ -0,0 +1,46 @@ +// +// Grade.swift +// MyCreditManager_jasonLee0223 +// +// Created by Jason on 2022/12/08. +// + +import Foundation + +enum Grade: Double, CaseIterable, CustomStringConvertible { + case APlus = 4.5 + case AZero = 4.0 + case BPlus = 3.5 + case BZero = 3.0 + case CPlus = 2.5 + case CZero = 2.0 + case DPlus = 1.5 + case DZero = 1 + case F = 0 + case Unknown = 100 + + var description: String { + switch self { + case .APlus: + return "A+" + case .AZero: + return "A0" + case .BPlus: + return "B+" + case .BZero: + return "B0" + case .CPlus: + return "C+" + case .CZero: + return "C0" + case .DPlus: + return "D+" + case .DZero: + return "D0" + case .F: + return "F" + case .Unknown: + return "" + } + } +} diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Process.swift b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Process.swift new file mode 100644 index 0000000..5966600 --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Process.swift @@ -0,0 +1,131 @@ +// +// Process.swift +// MyCreditManager_jasonLee0223 +// +// Created by Jason on 2022/12/06. +// + +import Foundation + +class Process: SystemMenu, DataManager { + private var dataTableArray = [DataTable]() + let printMessage = PrintMessage() + + func addToStudent() { + printMessage.enterStudentName() + let inputValue = receiveUserSingleInputValue() + let correctValue = getInvalidInput(receivedValue: inputValue) + if correctValue == nil { + return + } + + let studentName = dataTableArray.filter{ $0.name == inputValue }.map{ $0.name }.joined() + if featureOf(same: studentName, compare: inputValue) == true { + return + } + + guard let sendOfData = featureTo(add: correctValue) else { + return + } + dataTableArray.append(sendOfData) + printMessage.addStudent(inputValue) + } + + func deleteToStudent() { + printMessage.wishToDeleteStudentName() + let inputValue = receiveUserSingleInputValue() + let correctValue = getInvalidInput(receivedValue: inputValue) + if correctValue == nil { + return + } + + guard let filterElement = dataTableArray.filter({ $0.name == correctValue }).first else { + printMessage.notCollectDeleteStudent(inputValue) + return + } + + guard let findIndex = dataTableArray.firstIndex(of: filterElement) else { + return + } + dataTableArray.remove(at: findIndex) + printMessage.deleteStudent(inputValue) + } + + func addOrChangeToGrade() { + printMessage.enterTheGradeAndSubject() + + let inputThreeValues = receiveUserThreeInputValues() + let compareUserInput = inputThreeValues.map{$0 == "" || $0 == " "} + var isPossibleContinue: Bool = false + + for index in 0.. String? { + if studentName != dataTableArray.first?.name { + printMessage.invalidInputNotice() + return nil + } + return studentName + } +} + +//MARK: - Error Handling +extension Process { + func getInvalidInput(receivedValue: String) -> String? { + do { + _ = try featureOf(compare: receivedValue) + } catch DataError.invalidUserInputSingle(Value: receivedValue) { + printMessage.invalidInputNotice() + return nil + } catch { + fatalError("Wrong User Input") + } + return receivedValue + } +} diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Protocol/SystemMenu.swift b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Protocol/SystemMenu.swift new file mode 100644 index 0000000..2e28f58 --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/Model/Protocol/SystemMenu.swift @@ -0,0 +1,73 @@ +// +// SystemMenu.swift +// MyCreditManager_jasonLee0223 +// +// Created by Jason on 2022/12/06. +// + +import Foundation + +protocol SystemMenu { + func addToStudent() + func deleteToStudent() + func addOrChangeToGrade() + func deleteGrade() + func viewOfAverage() + func exitMenu(input value: String?) +} + +protocol DataManager { + func receiveUserSingleInputValue() -> String + func receiveUserThreeInputValues() -> [String] + func featureOf(compare inputValue: String) throws -> String + func featureOf(same name: String, compare value: String) -> Bool + func featureTo(add nameValue: String?) -> DataTable? + func delete() + func change() +} + +extension DataManager { + func receiveUserSingleInputValue() -> String { + guard let inputValue = readLine() else { + return "" + } + return inputValue + } + + func receiveUserThreeInputValues() -> [String] { + guard let inputThreeValues = readLine()?.components(separatedBy: " ") else { + return ["", "", ""] + } + return inputThreeValues + } + + func featureOf(compare inputValue: String) throws -> String { + guard inputValue != " " && inputValue != "" else { + throw DataError.invalidUserInputSingle(Value: inputValue) + } + return inputValue + } + + func featureOf(same name: String, compare userInput: String) -> Bool { + guard name == userInput else { + return false + } + PrintMessage().sameStudent(name) + return true + } + + func featureTo(add nameValue: String?) -> DataTable? { + guard let receivedData = nameValue else { + return nil + } + return DataTable(name: receivedData, subject: "", grade: .Unknown) + } + + func delete() { + // code + } + + func change() { + // code + } +} diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/View/PrintMessage.swift b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/View/PrintMessage.swift new file mode 100644 index 0000000..3c022ed --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/View/PrintMessage.swift @@ -0,0 +1,84 @@ +// +// PrintMessage.swift +// MyCreditManager_jasonLee0223 +// +// Created by Jason on 2022/12/06. +// + +import Foundation + +struct PrintMessage { + func initial() { + print("원하는 기능을 입력해주세요") + print("1: 학생추가, 2: 학생삭제, 3: 성적추가(변경), 4: 성적삭제, 5: 평점보기, X: 종료") + } + + func defaultError() { + print("뭔가 입력이 잘못되었습니다. 1~5 사이의 숫자 혹은 X를 입력해주세요.") + } + + //MARK: - 학생 추가 + func enterStudentName() { + print("추가할 학생의 이름을 입력해주세요") + } + + func invalidInputNotice() { + print("입력이 잘못되었습니다. 다시 확인해주세요.") + } + + func addStudent(_ name: String) { + print("\(name) 학생을 추가했습니다.") + } + + func sameStudent(_ name: String) { + print("\(name)은 이미 존재하는 학생입니다. 추가하지 않습니다.") + } + + //MARK: - 학생 삭제 + func wishToDeleteStudentName() { + print("삭제할 학생의 이름을 입력해주세요.") + } + + func deleteStudent(_ name: String) { + print("\(name) 학생을 삭제하였습니다.") + } + + func notCollectDeleteStudent(_ name: String) { + print("\(name) 학생을 찾지 못했습니다.") + } + + //MARK: - 성적 추가 + func enterTheGradeAndSubject() { + print("성적을 추가할 학생의 이름, 과목 이름, 성적(A+, A, F 등)을 띄어쓰기로 구분하여 차례로 작성해주세요.") + print("입력예) Mickey Swift A+") + print("만약에 학생의 성적 중 해당 과목이 존재하면 기존 점수가 갱신됩니다.") + } + + func collectThreeInputValue(_ name: String, _ subject: String, _ grade: String) { + print("\(name) 학생의 \(subject) 과목이 \(grade)로 추가(변경)되었습니다.") + } + + //MARK: - 성적 삭제 + func wishToDeleteGrade() { + print("성적을 삭제할 학생의 이름, 과목 이름을 띄어쓰기로 구분하여 차례로 작성해주세요.") + print("입력예) Mickey Swift") + } + + func canNotFoundStudent(_ name: String) { + print("\(name) 학생을 찾지 못했습니다.") + } + + func deleteGrade(_ name: String, _ subject: String) { + print("\(name) 학생의 \(subject) 과목의 성적이 삭제되었습니다.") + } + + //MARK: - 평점보기 + func wishToKnowAverage() { + print("평점을 알고싶은 학생의 이름을 입력해주세요.") + } + + //MARK: - 종료 + func endProcess() { + print("프로그램을 종료합니다...") + } +} diff --git a/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/main.swift b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/main.swift new file mode 100644 index 0000000..f25e418 --- /dev/null +++ b/MyCreditManager_jasonLee0223/MyCreditManager_jasonLee0223/main.swift @@ -0,0 +1,49 @@ +// +// main.swift +// MyCreditManager_jasonLee0223 +// +// Created by Jason on 2022/12/06. +// + +import Foundation + +final class MyCreditManager { + func menuStart() { + let process = Process() + let printMessage = PrintMessage() + var exitValue:String = "" + + repeat { + printMessage.initial() + + guard let inputValue = readLine() else { + return + } + + exitValue = inputValue + switch ExecuteMenu(rawValue: inputValue) { + case .addStudent: + process.addToStudent() + break + case .deleteStudent: + process.deleteToStudent() + break + case .addOrChangeToGrade: + process.addOrChangeToGrade() + break + case .deleteGrade: + process.deleteGrade() + break + case .averageView: + break + case .exitCommand: + process.exitMenu(input: inputValue) + break + + default: + printMessage.defaultError() + } + } while exitValue != "X" + } +} +MyCreditManager().menuStart()