Loop Pseudocode Exercises

 

For each exercise create detailed pseudocode or a flowchart in a Word document.  Write the programs after all psuedocode/flowcharts have been checked in.

 

1.  Prompt user for an int called diagonal.  The output should look like what’s shown below, stopping at diagonal.
     
      1
         2
            3
               4

2.  This time prompt for an int called step and create a staircase (using horizontal and vertical line segment chars) with step number of steps.

3.  Prompt user for his/her birth month as an integer.  Do not accept invalid entries.  A user should get exactly three tries to enter a valid month.  If the user fails to do this, he/she should be severely chastised for lack of brain power, and the program should end.  For a valid entry, display the name of the month using a switch statement.

4.  User enters decimal numbers a and b.
a.  Find the sum of all whole numbers in the interval [a, b].

      b.  Find all the product of all the odd numbers in the interval [a, b].