C#/수업과제
-
03/10 매개변수, 반환타입이 없는 메서드 정의 및 호출C#/수업과제 2021. 3. 11. 00:14
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study00 { class Program { static void Main(string[] args) { //매개변수, 반환타입이 없는 메서드 정의 및 호출 Console.WriteLine("메서드 호출"); AttackGoblin(); Die(); Revive(); UseSkill(); ShootGun(); Rest(); Sit(); UsePortal(); Sleep(); Save(); } //고블린 공격 static private void AttackGoblin() { Cons..
-
연산자, 선택문, 반복문, 점프문을 사용한 과제C#/수업과제 2021. 3. 10. 00:34
던파 레인저 무기인 제스 가텐을 강화 재료인 무색 큐브 조각을 전부 소모하거나 무기가 파괴될때까지 강화를 반복하는 코드 using System; namespace Study00 { class Program { static void Main(string[] args) { //변수 초기화 string itemName = "제스 가텐"; int colorlessCubePieces = 500; int colorlessCubePiecesConsumption = 0; int itemReinforce = 0; int percentage = 0; Random random = new Random(); int randomResult = 0; bool destructionPlug = false; while(true) { C..
-
변수정의 및 할당 출력 연습 10개C#/수업과제 2021. 3. 9. 00:37
1.화살 세례 using System; namespace Study00 { //디아블로3 직업 열거형 선언 enum eClass { Barbarian, Crusader, DemonHunter, Monk, WitchDoctor, Wizard, Necromancer } class Program { static void Main(string[] args) { //tab, enter 문자 상수 초기화 const char tab = (char)9; const char enter = (char)10; //무기정보변수 초기화 string itemName = "화살 세례"; string equipmentType = "한손 무기"; float minDps = 2180.8f; float maxDps = 2554.4f; s..