Question
I need to convert these from console to windows form app In this program we need to do 35 iterations and each time we need
I need to convert these from console to windows form app
In this program we need to do 35 iterations and each time we need to move by 3 step to complete the 35 iteration by moving 3 step we need to set range of loop from 1 to 105(35*3=105). So that in the end we get desired amount of iteration.After completing all the loop it will show a msgbox that prompt a message that "user's program performed 35 iteration".In this code you need to change "Name" variable value by your name.
Code-
Module VBModule Sub Main() Console.WriteLine("First Loop Program") 'Declaring Variables Dim iteration As Integer Dim Name As string 'intializing variables Name="Shivam" iteration=0 'creating loop from 1 to 105 incremanting by 3 For counter As Integer=1 to 105 Step 3 'iteration variable incremanting to count the no of iteration iteration=iteration+1 Next 'msgbox is creating by giving it message to show MsgBox(Name+"'s program performed "+(CStr(iteration))+" iterations") End Sub End Module
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Second Loop program:-
In the second program we need to only create a while loop so i have done it with the while loop and inserting a message "infinite loop" in it.
Code:-
Module VBModule Sub Main() Console.WriteLine("Second Loop Program") 'Creating infinite loop using While loop by making it true While true Console.WriteLine("Infinite Loop") End While End Sub End Module
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started