コード例 #1
0
        public static void Main(string[] args)
        {
            IOU mattsIOU = new IOU();

            mattsIOU.ChangeDebt("Arthur", -10);

            Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Arthur"));

            mattsIOU.ChangeDebt("Arthur", 51);
            mattsIOU.ChangeDebt("Arthur", 30);

            Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Arthur"));

            mattsIOU.ChangeDebt("Arthur", -30);

            Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Arthur"));

            mattsIOU.ChangeDebt("Arthur", -80);

            Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Arthur"));

            IOU juliusIOU = new IOU();

            juliusIOU.ChangeDebt("Meikku", 80);
            Console.WriteLine(juliusIOU.HowMuchDoIOweTo("Meikku"));

            juliusIOU.ChangeDebt("Meikku", -90);
            Console.WriteLine(juliusIOU.HowMuchDoIOweTo("Meikku"));
        }
コード例 #2
0
        public static void Main(string[] args)
        {
            IOU mattsIOU = new IOU();

            mattsIOU.ChangeDebt("Arthur", 51);
            mattsIOU.ChangeDebt("Arthur", 30);

            Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Arthur"));
            Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Michael"));
            Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Heikki"));

            /*IOU mattsIOU = new IOU();
             * mattsIOU.ChangeDebt("Arthur", -10);
             *
             * Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Arthur"));
             *
             * mattsIOU.ChangeDebt("Arthur", 51);
             * mattsIOU.ChangeDebt("Arthur", 30);
             *
             * Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Arthur"));
             *
             * mattsIOU.ChangeDebt("Arthur", -30);
             *
             * Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Arthur"));
             *
             * mattsIOU.ChangeDebt("Arthur", -80);
             *
             * Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Arthur"));*/
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: mirjaCentria/basic-coding
        public static void Main(string[] args)
        {
            IOU munIOU = new IOU();

            munIOU.ChangeDebt("Arthur", -51);
            Console.WriteLine(munIOU.HowMuchDoIOweTo("Arthur"));

            IOU mattsIOU = new IOU();

            mattsIOU.ChangeDebt("Arthur", 51);
            mattsIOU.ChangeDebt("Arthur", 30);


            Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Arthur"));

            mattsIOU.ChangeDebt("Arthur", -30);

            Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Arthur"));

            mattsIOU.ChangeDebt("Arthur", -80);

            Console.WriteLine(mattsIOU.HowMuchDoIOweTo("Arthur"));
        }