diff --git a/HelloStudents/App.config b/HelloStudents/App.config index bae5d6d..4bfa005 100644 --- a/HelloStudents/App.config +++ b/HelloStudents/App.config @@ -1,6 +1,6 @@ - + diff --git a/HelloStudents/HelloStudents.csproj b/HelloStudents/HelloStudents.csproj index 94dc10e..5a99910 100644 --- a/HelloStudents/HelloStudents.csproj +++ b/HelloStudents/HelloStudents.csproj @@ -8,7 +8,7 @@ Exe HelloStudents HelloStudents - v4.6.1 + v4.8 512 true true @@ -48,7 +48,6 @@ - @@ -60,7 +59,6 @@ - @@ -70,6 +68,7 @@ + diff --git a/HelloStudents/MyModule1.cs b/HelloStudents/MyModule1.cs deleted file mode 100644 index af749eb..0000000 --- a/HelloStudents/MyModule1.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Web; - -namespace HelloStudents -{ - public class MyModule1 : IHttpModule - { - /// - /// 이 모듈을 사용하려면 먼저 웹의 Web.config 파일에서 모듈을 - /// 구성하고 IIS에 등록해야 합니다. - /// 다음 링크 참조: https://go.microsoft.com/?linkid=8101007 - /// - #region IHttpModule 멤버 - - public void Dispose() - { - //여기에서 코드를 정리합니다. - } - - public void Init(HttpApplication context) - { - // 다음은 LogRequest 이벤트를 처리하여 사용자 지정 로깅 구현을 - // 이 이벤트에 제공하는 예입니다. - context.LogRequest += new EventHandler(OnLogRequest); - } - - #endregion - - public void OnLogRequest(Object source, EventArgs e) - { - //사용자 지정 로깅 논리를 여기에 사용할 수 있습니다. - } - } -} diff --git a/HelloStudents/Program.cs b/HelloStudents/Program.cs index fac8c80..b76bb37 100644 --- a/HelloStudents/Program.cs +++ b/HelloStudents/Program.cs @@ -1,9 +1,6 @@ // using은 java의 import 같은 역할 using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; //import // namespace는 java의 패키지 같은 역할 @@ -24,8 +21,10 @@ static void Main(string[] args) // 메서드 이름 대문자 students.Add( new Student3099Ham() { - FirstName = "기훈", LastName = "함", - StudentNumber = 3099, BaseYear = 2020 + FirstName = "기훈", + LastName = "함", + StudentNumber = 3099, + BaseYear = 2020 }); students.Add( new Student3199Ham() @@ -87,8 +86,10 @@ static void Main(string[] args) // 메서드 이름 대문자 students.Add( new Student3107Kim() { - FirstName = "정아", LastName = "김", - StudentNumber = 3107, BaseYear = 2019 + FirstName = "정아", + LastName = "김", + StudentNumber = 3107, + BaseYear = 2019 }); // 3108 students.Add( @@ -100,7 +101,7 @@ static void Main(string[] args) // 메서드 이름 대문자 BaseYear = 2021 }); // 3109 - students.Add( + students.Add( new Student3109Kim() { FirstName = "TaeYoung", @@ -117,12 +118,7 @@ static void Main(string[] args) // 메서드 이름 대문자 BaseYear = 2021 }); // 3111 - students.Add( - new Student3111Shin() - { - FirstName = "잎새", LastName = "신", - StudentNumber = 3111, BaseYear = 2019 - }); + // 3112 students.Add( new Student3112Oh() @@ -132,15 +128,7 @@ static void Main(string[] args) // 메서드 이름 대문자 StudentNumber = 3112, BaseYear = 2021 }); - // 3113 - students.Add( - new Student3113Lee() - { - FirstName = "수빈", - LastName = "이", - StudentNumber = 3113, - BaseYear = 2019 - }); + // 3114 students.Add( new Student3114Lee() @@ -163,8 +151,10 @@ static void Main(string[] args) // 메서드 이름 대문자 students.Add( new Student3116JO() { - FirstName = "서영", LastName = "조", - StudentNumber = 3116, BaseYear = 2020 + FirstName = "서영", + LastName = "조", + StudentNumber = 3116, + BaseYear = 2020 }); // 3117 students.Add( @@ -183,15 +173,7 @@ static void Main(string[] args) // 메서드 이름 대문자 StudentNumber = 3117, BaseYear = 2021 }); - // 3118 - students.Add( - new Student3118Choi() - { - FirstName = "수민", - LastName = "최", - StudentNumber = 3118, - }); - // 3119 + // 3120 // 3201 @@ -203,14 +185,7 @@ static void Main(string[] args) // 메서드 이름 대문자 // 3207 // 3208 // 3209 - students.Add( - new Student3209Kim() - { - FirstName = "진진", - LastName = "문", - StudentNumber = 3209, - BaseYear = 2021 - }); + // 3210 // 3211 students.Add( @@ -232,6 +207,14 @@ static void Main(string[] args) // 메서드 이름 대문자 StudentNumber = 3214, BaseYear = 2021 }); + students.Add( + new Student3214Lee() + { + FirstName = "지현", + LastName = "임", + StudentNumber = 3214, + BaseYear = 2024 + }); // 3215 // 3217 // 3218 @@ -242,7 +225,8 @@ static void Main(string[] args) // 메서드 이름 대문자 students.Sort(); // 명단 출력 - foreach( StudentBase student in students){ + foreach (StudentBase student in students) + { Console.WriteLine(student.Hello()); } } diff --git a/HelloStudents/Properties/AssemblyInfo.cs b/HelloStudents/Properties/AssemblyInfo.cs index b850e7a..153f206 100644 --- a/HelloStudents/Properties/AssemblyInfo.cs +++ b/HelloStudents/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 diff --git a/HelloStudents/Student3102Kang.cs b/HelloStudents/Student3102Kang.cs index cede5a3..91d7f6d 100644 --- a/HelloStudents/Student3102Kang.cs +++ b/HelloStudents/Student3102Kang.cs @@ -1,17 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3102Kang : StudentBase { public override string Hello() { //this 는 this.Tostring이랑 같음 - return "하이 나는 " + this + "이지렁 ㅋ"; + return "하이 나는 " + this + "이지렁 ㅋ"; } } } diff --git a/HelloStudents/Student3103Kim.cs b/HelloStudents/Student3103Kim.cs index b12c63c..974db8d 100644 --- a/HelloStudents/Student3103Kim.cs +++ b/HelloStudents/Student3103Kim.cs @@ -1,7 +1,7 @@ namespace HelloStudents { - + class Student3103Kim : StudentBase { public override string Hello() diff --git a/HelloStudents/Student3104Kim .cs b/HelloStudents/Student3104Kim .cs index 29ea6e2..ac4f312 100644 --- a/HelloStudents/Student3104Kim .cs +++ b/HelloStudents/Student3104Kim .cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3104Kim : StudentBase { diff --git a/HelloStudents/Student3105Kim.cs b/HelloStudents/Student3105Kim.cs index e7583a7..84b3c9c 100644 --- a/HelloStudents/Student3105Kim.cs +++ b/HelloStudents/Student3105Kim.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3105Kim : StudentBase { diff --git a/HelloStudents/Student3106Kim.cs b/HelloStudents/Student3106Kim.cs index 3574af0..d3358b2 100644 --- a/HelloStudents/Student3106Kim.cs +++ b/HelloStudents/Student3106Kim.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3106Kim : StudentBase { diff --git a/HelloStudents/Student3107Kim.cs b/HelloStudents/Student3107Kim.cs index b3de7b9..1353b80 100644 --- a/HelloStudents/Student3107Kim.cs +++ b/HelloStudents/Student3107Kim.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3107Kim : StudentBase { diff --git a/HelloStudents/Student3108Kim.cs b/HelloStudents/Student3108Kim.cs index 63c0686..27e8363 100644 --- a/HelloStudents/Student3108Kim.cs +++ b/HelloStudents/Student3108Kim.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3108Kim : StudentBase { diff --git a/HelloStudents/Student3109Kim.cs b/HelloStudents/Student3109Kim.cs index 78ad1c6..9939476 100644 --- a/HelloStudents/Student3109Kim.cs +++ b/HelloStudents/Student3109Kim.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3109Kim : StudentBase // 추상메소드 추가 { diff --git a/HelloStudents/Student3110Ryu.cs b/HelloStudents/Student3110Ryu.cs index 9180442..da491b3 100644 --- a/HelloStudents/Student3110Ryu.cs +++ b/HelloStudents/Student3110Ryu.cs @@ -1,17 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3110Ryu : StudentBase { public override string Hello() { - return "안녕 나는 "+this+"!"; + return "안녕 나는 " + this + "!"; } } } diff --git a/HelloStudents/Student3112Oh.cs b/HelloStudents/Student3112Oh.cs index be7f68e..1f23cef 100644 --- a/HelloStudents/Student3112Oh.cs +++ b/HelloStudents/Student3112Oh.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3112Oh : StudentBase // 상속 { diff --git a/HelloStudents/Student3113Lee.cs b/HelloStudents/Student3113Lee.cs deleted file mode 100644 index 57c7167..0000000 --- a/HelloStudents/Student3113Lee.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace HelloStudents -{ - - - class Student3113Lee : StudentBase - { - public override string Hello() - { - return "ȳϼ? " + this + "Դϴ!"; - } - } -}} \ No newline at end of file diff --git a/HelloStudents/Student3114Lee.cs b/HelloStudents/Student3114Lee.cs index 76c71a7..6740519 100644 --- a/HelloStudents/Student3114Lee.cs +++ b/HelloStudents/Student3114Lee.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3114Lee : StudentBase { diff --git a/HelloStudents/Student3115Lee.cs b/HelloStudents/Student3115Lee.cs index 6b26c00..0122146 100644 --- a/HelloStudents/Student3115Lee.cs +++ b/HelloStudents/Student3115Lee.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3115Lee : StudentBase { diff --git a/HelloStudents/Student3117Choi.cs b/HelloStudents/Student3117Choi.cs index a185975..14baed2 100644 --- a/HelloStudents/Student3117Choi.cs +++ b/HelloStudents/Student3117Choi.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3117Choi : StudentBase { diff --git a/HelloStudents/Student3118Choi.cs b/HelloStudents/Student3118Choi.cs index 3f661e2..12e190d 100644 --- a/HelloStudents/Student3118Choi.cs +++ b/HelloStudents/Student3118Choi.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Studnet3118Choi : StudentBase { diff --git a/HelloStudents/Student3199Ham.cs b/HelloStudents/Student3199Ham.cs index 006f537..d22e547 100644 --- a/HelloStudents/Student3199Ham.cs +++ b/HelloStudents/Student3199Ham.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3199Ham : StudentBase diff --git a/HelloStudents/Student3209Moon.cs b/HelloStudents/Student3209Moon.cs index ac1ae55..a0ee3e6 100644 --- a/HelloStudents/Student3209Moon.cs +++ b/HelloStudents/Student3209Moon.cs @@ -1,16 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { - class Student3209Moon:StudentBase + class Student3209Moon : StudentBase { public override string Hello() { - return "무야호~ 나는 " + this + "입니다!"; + return "무야호~ 나는 " + this + "입니다!"; } } } diff --git a/HelloStudents/Student3211Son.cs b/HelloStudents/Student3211Son.cs index 402ce48..5adae8f 100644 --- a/HelloStudents/Student3211Son.cs +++ b/HelloStudents/Student3211Son.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { class Student3211Son : StudentBase { diff --git a/HelloStudents/Student3214Lee.cs b/HelloStudents/Student3214Lee.cs index 029cb68..13cfcef 100644 --- a/HelloStudents/Student3214Lee.cs +++ b/HelloStudents/Student3214Lee.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HelloStudents +namespace HelloStudents { - class Student3214Lee:StudentBase + class Student3214Lee : StudentBase { public override string Hello() { diff --git a/HelloStudents/Student3214Lim.cs b/HelloStudents/Student3214Lim.cs new file mode 100644 index 0000000..0b09755 --- /dev/null +++ b/HelloStudents/Student3214Lim.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HelloStudents +{ + internal class Student3214Lim : StudentBase + { + // c# : override 명시, 문자열은 소문자(string), 앞 글자는 대문자 ex) ToString(),Equals()..등등 + public override string Hello() + { + // this -> ToString() 변환 + return "안녕하세요구르트! 저는 " + this + "입니다람쥐"; + } + } +} diff --git a/HelloStudents/StudentBase.cs b/HelloStudents/StudentBase.cs index 5555f5c..56775da 100644 --- a/HelloStudents/StudentBase.cs +++ b/HelloStudents/StudentBase.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace HelloStudents { @@ -16,7 +12,7 @@ abstract class StudentBase : IEquatable, IComparable // 오버라이드한 메서드 public override string ToString() // override --> 명시적으로 작성 { - return StudentNumber + " " + LastName +" " + FirstName; + return StudentNumber + " " + LastName + " " + FirstName; } // 구현해야 할 추상 메서드 @@ -24,7 +20,7 @@ public override string ToString() // override --> 명시적으로 // 같은지 비교하기 전에 비교 가능한 클래스인지 확인 후 같은지 비교하는 메서드 public override bool Equals(object obj) - { + { if (obj == null) return false; StudentBase objAsStudentBase = obj as StudentBase; if (objAsStudentBase == null) return false;