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
Related Q & A:
- What are the object-oriented features of Visual Basic.NET?Best solution by msdn.microsoft.com
- How to write a visual poem?Best solution by Yahoo! Answers
- Codes for a simple visual basic program.Best solution by vbtutor.net
- How do I write a Counter Argument for my persuasive essay?Best solution by Yahoo! Answers
- Is java or visual basic a machine level, low level, high level or binary level programming language?Best solution by Quora
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.