C#/수업내용 84

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

2020.04.20. 수업내용 - 아이템 수량만 늘리기(객체 생성 x)

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 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study_012 { class App { public App() { Inventory inventory = new Inventory(); inventory.Add(new Item("장검", 3)); inventory.Add(new Item("장검", 2)); inventory.Add(new Item("장검", 5)); } } } 2. Inve..

C#/수업내용 2020.04.21

2020.04.16. 수업내용 - 1) 문자열 분할하고 배열객체에 할당하기, 2) 배열 객체를 다른 클래스에 전달하기

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 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study_010 { class App { public App() { inventory inventory = new inventory(); //문자열 분할하기 string itemName ="장검,단검,활"; string[] strItemName=itemNam..

C#/수업내용 2020.04.16

2020.04.16. 수업내용 - 장바구니 (장바구니 클래스, 과일 클래스)

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 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study_010 { class App { public App() { ShoppingBag shoppingBag = new ShoppingBag(); shoppingBag.AddFruit(new Fruit("사과")); shoppingBag.AddFruit(new Fruit("바나나")); shoppingBag.AddFruit(new Fr..

C#/수업내용 2020.04.16

2020.04.13. 수업내용 - SiegeTank 클래스(enum), Factory 클래스

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 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study_008 { class App { public App() { Factory factory = new Factory(); SiegeTank tank = factory.CreateTank(); tank.Move(); tank.ChangeMode(); tank.Move(); } } } 2. Factory class 1 2 3 4 5 6 7 ..

C#/수업내용 2020.04.13