using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _230105
{
    class Missile
    {
        const int MAX_ATT = 5;

        public Missile()
        {
            for (int i = 0; i < MAX_ATT; i++)
            {
                int count = i + 1;
                Console.WriteLine("{0}번 공격하였습니다.", count);
            }
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _230105
{
    class App
    {
        public App()
        {
            Valkyrie valkyrie = new Valkyrie();

            valkyrie.Move();
            valkyrie.Att();
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _230105
{
    class Valkyrie
    {
        public Valkyrie()
        {
            Console.WriteLine("발키리가 생성되었습니다.");
        }

        public void Move()
        {
            Console.WriteLine("이동하였습니다.");
        }

        public void Att()
        {
            Missile missile = new Missile();
        }

    }
}

'C# > 수업 과제' 카테고리의 다른 글

배열을 활용한 인벤토리 구현  (0) 2023.01.06
클래서,메서드 과제5  (0) 2023.01.05
클래스/메서드 과제3  (0) 2023.01.05
클래스/메서드 과제2  (0) 2023.01.05
클래스/메서드 과제1  (0) 2023.01.05

+ Recent posts