<p> 1 of 1 03-1-HO-Loops Hand out</p><p>Along with sequences and decisions, loops are an important construct in programming.</p><p>In the programs that were written before, the program requested the user enter 2 numbers then select from a menu of choices. The program then ended. If the person required 2 more numbers to be worked on then the program has to be executed again.</p><p>Most programs want to do processing over and over again until a decision to stop is reached. This requires a loop and a condition for looping. Here is a sample and simple program.</p><p>Write a program that Asks for 2 numbers called n1 and n2 Displays the two numbers and the total on one line but does NOT use a total variable Displays how many times you have been in the loop It continues until the user decides to stop the program</p><p>03-1-HO-Loops Hand out</p><p>Along with sequences and decisions, loops are an important construct in programming.</p><p>In the programs that were written before, the program requested the user enter 2 numbers then select from a menu of choices. The program then ended. If the person required 2 more numbers to be worked on then the program has to be executed again.</p><p>Most programs want to do processing over and over again until a decision to stop is reached. This requires a loop and a condition for looping. Here is a sample and simple program.</p><p>Write a program that Asks for 2 numbers called n1 and n2 Displays the two numbers and the total on one line but does NOT use a total variable Displays how many times you have been in the loop It continues until the user decides to stop the program</p><p>0dcbe0c83fa8f231b2b44c10725b6376.doc by rt -- 4/4/2018 1 of 1</p>
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages1 Page
-
File Size-