Ejemplo n.º 1
0
        protected String buildSolution()
        {
            StringBuilder s = new StringBuilder(4000);

            s.AppendFormat(nd.SelectSingleNode("Soln").InnerText);
            s.Replace("Start_Speed", Start_Speed.ToString());
            s.Replace("End_Speed", End_Speed.ToString());
            s.Replace("Travel_Gravity", Travel_Gravity.ToString());
            s.Replace("Time_Taken", Time_Taken.ToString());
            s.Replace("Distance_Traveled", Distance_Traveled.ToString());
            return(s.ToString());


            //StringBuilder s = new StringBuilder(4000);
            //s.AppendFormat("<b>Detailed Solution:</b><br>");

            //s.AppendFormat("<br> Sales Amount:${0}", Sales_Amt);
            //s.AppendFormat("<br> Commission Percent:{0}%", Commission_Percent);
            //s.AppendFormat("<br><br><b>Step 1: Form problem statement:</b>");
            //s.AppendFormat("<br> What is {0}% of {1}?", Commission_Percent, Sales_Amt);
            //s.AppendFormat("<br> So x = ({0}%) ({1})", Commission_Percent, Sales_Amt);
            //s.AppendFormat("<br><br><b>Step 2: Calculate x:</b>");
            //s.AppendFormat("<br> x = ({0}/100) ({1}) = {2}", Commission_Percent, Sales_Amt, Answer);


            //s.AppendFormat("<br><br><b> Answer :</b>");
            //s.AppendFormat("${0}", Answer);

            //return s.ToString();
        }
Ejemplo n.º 2
0
        protected override String createQuestion()
        {
            string s;

            s = createQns(); //questionPrototype.ElementAt(QnsNo);
            StringBuilder question = new StringBuilder(s);


            Time_Taken        = generateTime_Taken();
            Start_Speed       = generateStart_Speed();
            End_Speed         = CalculateEnd_Speed();
            Distance_Traveled = CalculateDistance_Traveled();

            question.Replace("Start_Speed", Start_Speed.ToString());
            question.Replace("End_Speed", End_Speed.ToString());
            question.Replace("Travel_Gravity", Travel_Gravity.ToString());
            question.Replace("Time_Taken", Time_Taken.ToString());
            question.Replace("Distance_Traveled", Distance_Traveled.ToString());

            return(question.ToString());
        }