Search This Blog

Monday, October 25, 2010

Programming Pre-test Post test do until loop

Which of the following is a pre-test, counter-controlled Do Until loop?


A.
Do
  Console.WriteLine("Enter an Exam Score: ")
  sum = sum + Convert.ToDouble(Console.ReadLine())
  counter += 1
Loop Until (counter > numberOfExams)
B.
Loop
  Console.WriteLine("Enter an Exam Score: ")
  sum = sum + Convert.ToDouble(Console.ReadLine())
  counter += 1
Do Until (counter > numberOfExams)
C.
Do Until (counter > numberOfExams)
   Console.WriteLine("Enter an Exam Score: ")
   sum = sum + Convert.ToDouble(Console.ReadLine())
   counter += 1
Loop
D.
Do Until (counter > numberOfExams)
   Console.WriteLine("Enter an Exam Score: ")
   sum = sum + Convert.ToDouble(Console.ReadLine())
   counter += 1
End Do


No comments:

Post a Comment