Preview

Repetition Structure

Good Essays
Open Document
Open Document
885 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Repetition Structure
In Visual Basic the loop structure will allow you to run one or more lines of code repetitively. In the loop structure you have the ability to repeat statements until the condition is true, false, a specified number of times, or once for each element in a collection. In Visual Basic several problems require repetition capability, in which the sequence or calculation of instructions is repeated over and over using different sets of data. Some examples would include continual checking of user data entries until an acceptable entry i.e a valid password is made. With computer programs the power comes from being able to repeat the same calculation or sequence of instructions several times over each time using different data. It uses different data without having to rerun the program for each new set of data values. Visual Basic has three different types of repetition structures, do while structures, for structures, and do/loop until structures. If it is true the code will be executed and if it is false the cold will not be executed. Statements that initially sets the condition is it must always be placed before the condition is first evaluated to ensure the correct loop execution the first time. Statements within the repeating section of code that allows the condition to become false. Using loops one of the things what you will be able to use is the While loop. A While loop does what it sounds like. While the condition(s) are true do the same task. Loops have two parts first a condition that gets tested for true or false value and the second is a statement or set of statements that’s is repeated as long as the condition is true. Do while loops is the expression after the keywords Do While. It’s the condition that is tested to determine if the statements provided before the “Loop Statement” are executed. The Do While loop is evaluated the same as in the If-Else statement. The difference between the two is in how the expression is used. In the Do While Loop the

You May Also Find These Documents Helpful

  • Powerful Essays

    1. The program will present a series of user screens that prompts the user for specified input.…

    • 1488 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    Nt1330 Unit 2 Assignment 1

    • 3740 Words
    • 15 Pages

    1. A while loop will not execute the body of the code if you have your test condition incorrect.…

    • 3740 Words
    • 15 Pages
    Satisfactory Essays
  • Good Essays

    It/210 Final Exam

    • 1235 Words
    • 5 Pages

    1. The program will present a series of user screens that prompts the user for specified input.…

    • 1235 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Homework Unit 3

    • 354 Words
    • 2 Pages

    1. Statements are execute in order according to the program code. Complex programs can need the help of a decision structure. Statements have to be true to be executed.…

    • 354 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    unit 7 assignment 1

    • 431 Words
    • 2 Pages

    3. What is a condition-controlled loop? A condition-controlled loop uses a true/false condition to control the number of times it repeats.…

    • 431 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    The language for which the compiler has been made is named as “M#”. M# is a general-purpose programming language having the most basic functionalities in it. This language basically focuses on the mathematical calculations, which are done using arithmetic operators and a few relational operators. M# is a case sensitive language.…

    • 703 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Academic penalties will be applied in cases where plagiarism or other forms of cheating have been observed. Once must read the Policy on Plagiarism and Cheating for Examinations from Section 7 of the Undergraduate Calendar which is available on the University of Manitoba Undergraduate Calendar. There are serious ramifications for academic dishonesty. For instance, one could receive an F on their transcript with the notation “CW” which indicates a compulsory withdrawal. A grade of zero may even be given on a test or assignment. The ramifications are stark and penalties include suspensions for up to five years which prevents one from registering in courses which…

    • 346 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Pt1420 Unit 1 Assignment 2

    • 1305 Words
    • 6 Pages

    Das, D., Gregersen, E., Hosch, L., Lotha, G., Sampaolo, M., Sinha, S. (2014). C++. In Encyclopedia Britannica.…

    • 1305 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    List three examples that show when a condition-controlled is better than count-controlled loop in programming?…

    • 351 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Case Analysis

    • 293 Words
    • 2 Pages

    2. You need to write 1 while loop followed by 3 if/else statements. - Borderline, try to avoid.…

    • 293 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    IT 210 appendix d

    • 264 Words
    • 2 Pages

    H. Running a program using various sets of inputs to determine if the program is running properly…

    • 264 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Cosc-2436-73426 Project 2

    • 306 Words
    • 2 Pages

    return -1 // if the while loop exit without retuning a value it means the value…

    • 306 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    After results from try 1 and try 2 are gotten, record it in a table like this:…

    • 1604 Words
    • 7 Pages
    Good Essays
  • Good Essays

    Loops are programming devices that specify that a section of a program is to be performed one or more times. Typically they are divided into two categories, "for loops" and "while loops". A "for loop" is executed a set number of times. A "while loop" continues to execute until a predefined condition is met. Creating an infinite loop is a very common occurrence for developers…

    • 733 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Art is expression through creativity that allows us to deliver a message that may be more significant than just words on a page. Art connects with people on a more emotional and spiritual level, and it is this that can help to drive home the artists message in his or her works. Natalie Czech’s “A Poem by Repetition by Allen Ginsberg” combines two powerful pieces of art, poetry and photography to create one cohesive piece of art. The art is inspired by writings documented in Ginsberg’s personal journal; not originally being a poet, Ginsberg later had his journal turned into a poem. Czech later discovered the poems and altered the ending to a broader form of self-appreciation, changing the last line of the poem from “anybody,” to “anything.”…

    • 665 Words
    • 3 Pages
    Good Essays

Related Topics