public static void Run()
 {
     // warms up the methods
     Question1.Answer(0.0, 0.0, 0.0);
     Question2.Answer(new int[] { 0 }, new int[] { 0 }, new int[] { 0 });
     Question3.Answer(new int[] { 0 }, new int[] { 0 });
     Question4.Answer(new int[] { 0 }, new int[] { 0 }, 0);
     Question5.Answer(new int[] { 0 });
     Question6.Answer(new string[] { "AA", "AA" });
 }
Exemplo n.º 2
0
        TimedAnswer <int> getSecondAnwser(Test <Cashflows> test)
        {
            var timer = new Stopwatch();

            Cashflows cashflows = test.GetInput();

            timer.Start();

            var answer = Question2.Answer(cashflows.cashFlowIn, cashflows.cashFlowOut);

            timer.Stop();

            var timeTaken = ((double)timer.ElapsedTicks / Stopwatch.Frequency) * 1000000000;

            return(new TimedAnswer <int>(answer, timeTaken));
        }
Exemplo n.º 3
0
        Answer getSecondAnswer(Q2Object input, TestCase test)
        {
            var timer = new Stopwatch();

            timer.Start();

            var answer = Question2.Answer(input.risk, input.bonus, input.trader);

            timer.Stop();

            var timeTaken = ((double)timer.ElapsedTicks / Stopwatch.Frequency) * 1000000000;

            return(new Answer()
            {
                questionNumber = 2,
                testNumber = test.testNumber,
                correct = answer == test.output ? "CORRECT" : "INCORRECT",
                speed = timeTaken
            });
        }
        Answer getSecondAnswer(Cashflows input, TestCase test)
        {
            var timer = new Stopwatch();

            timer.Start();

            var answer = Question2.Answer(input.cashFlowIn, input.cashFlowOut);

            timer.Stop();

            var timeTaken = ((double)timer.ElapsedTicks / Stopwatch.Frequency) * 1000000000;

            return new Answer()
            {
                questionNumber = 2,
                testNumber = test.testNumber,
                correct = answer == test.output ? "CORRECT" : "INCORRECT",
                speed = timeTaken
            };
        }