Week 4 Discussion Problems

Week 4 Discussion Problems - Week 4 D iscussion P roblems...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Week 4 Discussion Problems For the following problems, design the flowchart and pseudo code that solves the problem. You will write these loops in the program for simplicity. Also, try implementing your solutions in Visual Basic. We provide some examples to get you started. Example 1: Loops that Count Write a program in pseudo code that displays the numbers 1 to 10 inclusive. Use a while loop. Pseudo Code Flowchart Start Declare Variables Numeric count count= 1 while count<=10 Display count count= count+1 end while Stop
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Example 1: Matched Problems 1. Write a program that displays the numbers 23 to 45 inclusive. Use a while loop. 2. Write a program that displays all the odd numbers between 5 and 21 inclusive. Use a while loop. 3. Write a program that displays the numbers 20 to 13 in descending order. Use a while loop. (Hint: before your loop, make count= 20. Make your loop execute while count >=13. Make sure you DECREMENT your counter by 1 each time, ie, count= count-1) 4. Write a program that displays the numbers 15 to 8 in descending order. Use a while loop (this problems is like the previous question). 5. Write a program that displays all the even numbers between 2 and 12 inclusive. Use a do while loop (Hint: your counter will need to increment by 2 each time) 6. Write a program that displays all the odd numbers between 3 and 19 inclusive. Example 2:
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/27/2009 for the course BIS 311 taught by Professor Marshburn during the Fall '08 term at DeVry Cincinnati.

Page1 / 8

Week 4 Discussion Problems - Week 4 D iscussion P roblems...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online