How To Recharge Loop Mobile?

Visual basic write a counter control do while loop?

  • ' DoubleQuadruple.vb - This program prints the numbers 0 through 10 along ' with these values doubled and quadrupled. ' Input: None ' Output: Prints the numbers 0 through 10 along with their doubles and quadruples Option Explicit On Option Strict On Module DoubleQuadruple Sub Main() ' Declarations Const head1 As String = "Number: " Const head2 As String = "Doubled: " Const head3 As String = "Quadrupled: " Dim numberCounter As Integer ' Numbers 0 through 10 Dim doubled As Integer ' Stores the double of a number Dim quadrupled As Integer ' Stores the quadruple of a number Const NUM_LOOPS As Integer = 10 ' Constant used to control loop ' This is the work done in the housekeeping() procedure System.Console.WriteLine("0 through 10 doubled and quadrupled") ' This is the work done in the detailLoop() procedure numberCounter = 0 ' Initialize loop control variable 'Write your Do While Loop here End Sub ' End of Main() procedure End Module ' End of DoubleQuadruple module I'm very confused on what to do. My instructions are to write a counter-controlled Do While loop that uses loop control variable to take on the values 0 through 10. Remember to initialize the loop control variable before the program enters the loop. Then, in the body of the loop calculate the double and the quadruple using the value of the loop control variable in the body of the loop. Remember to include comments. Thanks for all those help!

  • Answer:

    The following is the basic code. You can make comments as you desire. I tested the code when I wrote it. Module Module1 Sub Main() Dim Num As Integer = 0 Dim DoubleNumber As Integer Dim QuadNumber As Integer Do While Num <= 9 Num += 1 DoubleNumber = 2 * Num QuadNumber = 4 * Num Console.WriteLine("The number is " & Num & " double this number is " & DoubleNumber & ", and quadruple this number is " & QuadNumber) Loop Console.WriteLine() Console.WriteLine() Console.WriteLine() Console.WriteLine() Console.WriteLine("PRESS ENTER KEY TO EXIT") Console.ReadLine() End Sub End Module TexMav

Midnite at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.