Пример #1
0
        /// <summary>
        /// Display MultiQ stats
        /// </summary>
        /// <param name="obj">multiQ object</param>
        /// <param name="queriedNumbers">contain list of queried numbers</param>
        /// <param name="factors">factor values</param>
        public static void DisplayMultiQStat(multiQ obj, int[] queriedNumbers, int[] factors)
        {
            string strFactorValues = ConvertArrayToString(factors);
            string strQueryNumbers = ConvertArrayToString(queriedNumbers);

            int[]  arrSuccessQueriedNumbers = obj.GetQueriedNumberList();
            string strSuccessQueriedNumbers = ParseArrayValuesToString(arrSuccessQueriedNumbers);

            Console.WriteLine("  Total queried numbers: {0}", strQueryNumbers);
            Console.WriteLine("  Factor values: {0}", strFactorValues);
            Console.WriteLine("  Stats from MultiQ class");
            Console.WriteLine("    Successful queried numbers: {0}", strSuccessQueriedNumbers);
            Console.WriteLine("    Max queried number: {0}", obj.GetMaxQuery());
            Console.WriteLine("    Min queried number: {0}", obj.GetMinQuery());
            Console.WriteLine("    Average queried number: {0}", obj.GetAvgQuery());
            Console.WriteLine("    Total successful queried count: {0}", obj.GetQueryCount());
        }
Пример #2
0
        /// <summary>
        /// Reset MultiQ private data members to initial value
        /// </summary>
        /// <param name="qObj"></param>
        public static void ResetMultiQObject(multiQ qObj)
        {
            Console.WriteLine("\n");
            Console.WriteLine(" Begin reset MultiQ object");
            qObj.Reset();
            int[]  arrSuccessQueriedNumbers = qObj.GetQueriedNumberList();
            string strSuccessQueriedNumbers = ParseArrayValuesToString(arrSuccessQueriedNumbers);

            Console.WriteLine("  Reset MultiQ object");

            Console.WriteLine("  Stats from MultiQ class");
            Console.WriteLine("    Successful queried numbers: {0}", strSuccessQueriedNumbers);
            Console.WriteLine("    Max queried number: {0}", qObj.GetMaxQuery());
            Console.WriteLine("    Min queried number: {0}", qObj.GetMinQuery());
            Console.WriteLine("    Average queried number: {0}", qObj.GetAvgQuery());
            Console.WriteLine("    Total successful queried count: {0}", qObj.GetQueryCount());

            Console.WriteLine(" End reset MultiQ object");
            Console.WriteLine("\n");
        }