03-1-HO-Loops Hand Out

03-1-HO-Loops Hand Out

<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>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us