전체 글 227

2020.04.22. 과제 - 객체지향[OOP] 프로그래밍 특징 / 5대 원칙

객체지향 프로그래밍의 특징 1. 캡슐화( Encapsulation ) 1) '은닉화'라고도 하며 데이터(속성)와 데이터를 처리하는 함수를 하나로 묶은 것을 의미한다. 2) 외부에서 잘못된 접근을 할 경우 객체의 데이터나 메소드에 유효하지 않은 값이 들어가서 오류가 나는 것을 방지한다. 이를 정보은닉(Information Hiding)이라고 한다. 3) 엑세스 한정자(접근 제한자)를 두어 어디까지 보호할 것인지, 노출시킬 것인지 설정한다. 4) 캡슐화된 객체들은 재사용 할 수 있다. 2. 추상화( Abstraction ) 1) 객체들의 공통 특징(property, mothod)를 뽑아 클래스로 구현한다. 2) 불필요한 부분들은 생략하고 필요한 부분만 개략화한다(모델화) 3) 시스템을 구현하기 전에 유사한 ..

C#/과제 2020.04.22

2020.04.22. 수업내용 - json 파일 읽고 쓰기(불러오기, 저장하기)

사용할 엑셀 데이터 1. App class 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 12..

C#/수업내용 2020.04.22

2020.04.21. 과제 - json 파일 불러오기

오늘 배운 방법 외에 추가로 한가지 밖에 못 찾았습니다 json 파일로 변환할 item_data 엑셀 데이터 (homeEscape 게임 아이템) 1. File.ReadAllText(string path) 메서드로 읽어오기 1) App class 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; ..

C#/과제 2020.04.21

2020.04.21. 수업내용 - Json 파일 만들고 프로그램에 넣기

1.excel 파일->json파일로 만들기 2.컨버트: https://shancarter.github.io/mr-data-converter/ Mr. Data Converter shancarter.github.io http://jsonviewer.stack.hu/ Online JSON Viewer jsonviewer.stack.hu 3.NewtonSoft.Json 추가 4.바인딩(맵핑)클래스 만들기(~~~data.cs) 5.json문자열->객체(역직렬화) 6.dictionary 에 옮겨담기 7. App class 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 4..

C#/수업내용 2020.04.21

2020.04.21. 수업내용 - Dictionary 개요

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study_013_1 { class App { public App() { //컬렉션 중의 하나, 각각의 요소들이 키와 값으..

C#/수업내용 2020.04.21

6. 문자열에 특정 문자열이 포홤되는 지 확인하기( Contains( ) )

1. 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study_013_1 { class App { public App() { string s1 = "the Lazy dog, fox"; string s2 = "fox"; bool b; b = s1.Contains(s2); //s2가 s1에 포함되면 true / 포함되지 않으면 false Console.WriteLine("{0}", b); //True..

C#/Problems 2020.04.21

5. 한 줄 출력시 ( Console.Write( ); ) 입력을 다음 줄로 넘기기, 마지막 쉼표 없애기

1. 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study_013_1 { class App { public App() { int length = 3; int j = 0; for(int i=0; i=length-1) { Console.Write("{0}", i); Console.WriteLine(); } else { Console.Wri..

C#/Problems 2020.04.21