전체 글 227

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.14. 과제 - 아이템 배열 값 빼기, 배열 정리하기(Inventory class, Item class)

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 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study_009 { class App { public App() { //인벤토리 생성 Inventory inventory = new Inventory(); //아이템 생성 및 배열에 추가하는 메서드 ..

C#/과제 2020.04.14