1.
이후 메모장 캡쳐는 생략하겠습니다.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
//변수설정 및 값 할당
string name = "AIDAN'S REVENGE";
string category = "Axe";
string subCategory = "1-hand";
float dps = 10.4f;
string dpsDescript = "Damage Per Second";
int minDamage = 6;
int maxDamage = 10;
string damage = "{0}-{1} Damage";
float aps = 1.30f;
string apsDescript = "{0:f2} Attacks per Second";
//출력
Console.WriteLine(name);
Console.WriteLine(category);
Console.WriteLine(subCategory);
Console.WriteLine(dps);
Console.WriteLine(dpsDescript);
Console.WriteLine(damage, minDamage, maxDamage);
Console.WriteLine(apsDescript, aps);
}
}
}
코딩
-----------------------------------------------------------------------------------------------------------------------------------
2.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
//변수 선언 및 값 설정
string name = "SHOES";
string subCategory = "Boots";
string part = "Feet";
int minDef = 7;
int maxDef = 8;
string Category = "Armor";
//출력
Console.WriteLine(name);
Console.WriteLine(subCategory);
Console.WriteLine(part);
Console.WriteLine("{0}-{1}", minDef, maxDef);
Console.WriteLine(Category);
}
}
}
-----------------------------------------------------------------------------------------------------------------------------------
3.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
//변수 선언 및 값 설정
string name = "MASTER LEGWRAPS";
string grade = "Rare";
string subCategory = "Pants";
string part = "Legs";
int minDef = 102;
int maxDef = 131;
string category = "Armor";
string option = "+{0} Random Magic Properties";
int propertiesCount = 4;
//출력
Console.WriteLine(name);
Console.WriteLine("{0} {1}", grade, subCategory);
Console.WriteLine(part);
Console.WriteLine("{0}-{1}", minDef, maxDef);
Console.WriteLine(category);
Console.WriteLine(option, propertiesCount);
}
}
}
문자열을 나란히 출력하는 방법에서 헤맸다
-----------------------------------------------------------------------------------------------------------------------------------
4.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
//변수 선언 및 값 설정
string name = "APPRENTICE HIDE BELT";
string grade = "Magic";
string subCategory = "Belt";
string part = "Waist";
int minDef = 14;
int maxDef = 16;
string category = "Armor";
string option = "+{0} Random Magic Properties";
int propertiesCount = 2;
//출력
Console.WriteLine(name);
Console.WriteLine("{0} {1}", grade, subCategory);
Console.WriteLine(part);
Console.WriteLine("{0}-{1}", minDef, maxDef);
Console.WriteLine(category);
Console.WriteLine(option, propertiesCount);
}
}
}
-----------------------------------------------------------------------------------------------------------------------------------
5.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
//변수 선언 및 값 설정
string name = "GLOVES OF WORSHIP";
string grade = "Legendary";
string subCategory = "Gloves";
string part = "Hands";
int minDef = 42;
int maxDef = 55;
string category = "Armor";
string itemExplain1 = "Primary";
string mainOption1 = "Critical Hit Damage Increased by [{0:f1} - {1:f1}]%";
float minIncDamageValue = 26.0f;
float maxIncDamageValue = 50.0f;
string mainOption2 = "+[{0} - {1}] Life per Hit";
int minIncLifeValue = 7737;
int maxIncLifeValue = 9214;
string itemExplain2 = "Secondary";
string mainOption3 = "Shrine effects last for {0} minutes. (Emanates)";
int durationTime = 10;
string subOption1 = "One of {0} Magic Properties (varies)";
int propertiesCount = 3;
string propertiesOption1 = "+[{0} - {1}] Strength";
string propertiesOption2 = "+[{0} - {1}] Dexterity";
string propertiesOption3 = "+[{0} - {1}] Intelligence";
int minPropertiesValue = 626;
int maxPropertiesValue = 750;
string subOption2 = "+{0} Random Magic Properties";
int IncPropertiesCount = 2;
string attribute = "Account Bound";
//출력
Console.WriteLine(name);
Console.WriteLine("{0} {1}", grade, subCategory);
Console.WriteLine(part);
Console.WriteLine("{0}-{1}", minDef, maxDef);
Console.WriteLine(category);
Console.WriteLine(itemExplain1);
Console.WriteLine(mainOption1, minIncDamageValue, maxIncDamageValue);
Console.WriteLine(mainOption2, minIncLifeValue, maxIncLifeValue);
Console.WriteLine(itemExplain2);
Console.WriteLine(mainOption3, durationTime);
Console.WriteLine(subOption1, propertiesCount);
Console.WriteLine(propertiesOption1, minPropertiesValue, maxPropertiesValue);
Console.WriteLine(propertiesOption2, minPropertiesValue, maxPropertiesValue);
Console.WriteLine(propertiesOption3, minPropertiesValue, maxPropertiesValue);
Console.WriteLine(subOption2, IncPropertiesCount);
Console.WriteLine(attribute);
Console.WriteLine();
}
}
}
-----------------------------------------------------------------------------------------------------------------------------------
6.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
//변수 선언 및 값 할당
string name = "BRACERS";
string subCategory = "Bracers";
string part = "Wrists";
int minDef = 8;
int maxDef = 9;
string Def = "{0} - {1}";
string category = "Armor";
string needed = "Requires level{0}";
int needLevel = 1;
//출력
Console.WriteLine(name);
Console.WriteLine(subCategory);
Console.WriteLine(part);
Console.WriteLine(Def, minDef, maxDef);
Console.WriteLine(category);
Console.WriteLine(needed, needLevel);
}
}
}
-----------------------------------------------------------------------------------------------------------------------------------
7.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
//변수 선언 및 값 할당
string name = "CLOTH TUNIC";
string subCategory = "Chest Armor";
string part = "Torso";
int Def = 3;
string category = "Armor";
string needed = "Requires level{0}";
int needLevel = 1;
//출력
Console.WriteLine(name);
Console.WriteLine(subCategory);
Console.WriteLine(part);
Console.WriteLine(Def);
Console.WriteLine(category);
Console.WriteLine(needed, needLevel);
}
}
}
-----------------------------------------------------------------------------------------------------------------------------------
8.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
//변수 선언 및 값 할당
string name = "LEATHER MANTLE";
string subCategory = "Shoulders";
string part = "Shoulders";
int minDef = 34;
int maxDef = 47;
string Def = "{0} - {1}";
string category = "Armor";
string needed = "Requires level {0}";
int needLevel = 10;
//출력
Console.WriteLine(name);
Console.WriteLine(subCategory);
Console.WriteLine(part);
Console.WriteLine(Def, minDef, maxDef);
Console.WriteLine(category);
Console.WriteLine(needed, needLevel);
}
}
}
-----------------------------------------------------------------------------------------------------------------------------------
9.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
//변수 선언 및 값 할당
string name = "SIMPLE DAGGER";
string subCategory = "1-Hand";
string category = "Dagger";
float dps = 6.0f;
string dpsDescript = "Damage Per Second";
int minDamage = 2;
int maxDamage = 6;
string damage = "{0}-{1} Damage";
float aps = 1.50f;
string apsDescript = "{0:f2} Attacks per Second";
string needed = "Requires level {0}";
int needLevel = 1;
//출력
Console.WriteLine(name);
Console.WriteLine(subCategory);
Console.WriteLine(category);
Console.WriteLine("{0:f1}", dps);
Console.WriteLine(dpsDescript);
Console.WriteLine(damage, minDamage, maxDamage);
Console.WriteLine(apsDescript, aps);
Console.WriteLine(needed, needLevel);
}
}
}
-----------------------------------------------------------------------------------------------------------------------------------
10.마지막
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
//변수 선언 및 값 할당
string name = "STEFFON'S HEAVY LANCE";
string subCategory = "1-Hand";
string category = "Spear";
float dps = 7.2f;
string dpsDescript = "Damage Per Second";
int minDamage = 5;
int maxDamage = 7;
string damage = "{0}-{1} Damage";
float aps = 1.20f;
string apsDescript = "{0:f2} Attacks per Second";
string needed = "Requires level {0}";
int needLevel = 1;
//출력
Console.WriteLine(name);
Console.WriteLine(subCategory);
Console.WriteLine(category);
Console.WriteLine("{0:f1}", dps);
Console.WriteLine(dpsDescript);
Console.WriteLine(damage, minDamage, maxDamage);
Console.WriteLine(apsDescript, aps);
Console.WriteLine(needed, needLevel);
}
}
}
'C# > 수업 과제' 카테고리의 다른 글
클래스 및 인스턴스 만들기와 메서드 연습2 (하이템플러-아콘) (0) | 2021.12.23 |
---|---|
클래스 및 인스턴스 만들기와 메서드 연습1 (라바-저글링) (0) | 2021.12.23 |
반환값이 있는 메서드 작성 (scv 미네랄, 가스 캐기, 좌표) (0) | 2021.12.23 |
삼일째 수업 복습 (0) | 2021.12.23 |
과제2 (0) | 2021.12.23 |