Description: Write a program to calculate prime numbers. First, the user is instructed to enter the number of primes to be displayed, and is prompted to enter an integer in the range [1 ... 200]. The user enters a number, n, and the program verifies that 1 ≤ n ≤ 200. If n is out of range, the user is re-prompted until they enter a value in the specified range. The program then calculates and displays all of the prime numbers up to and including the nth prime. The results must be displayed 10 prime numbers per line, in ascending order, with at least 3 spaces between the numbers. The final row may contain fewer than 10 values.
Program Requirements
The programmer's name and program title must appear in the output.
The counting loop (1 to n) must be implemented using the LOOP instruction.
The main procedure must consist of only procedure calls (with any necessary framing). It should be a readable "list" of what the program will do.
Each procedure will implement a section of the program logic, i.e., each procedure will specify how the logic of its section is implemented. The program must be modularized into at least the following procedures and sub-procedures:
introduction
getUserData
validate
showPrimes
isPrime
farewell
The upper and lower bounds of user input must be defined as constants.
If the user enters a number outside the range [1 ... 200], an error message must be displayed and the user must be prompted to re-enter the number of primes to be shown.
The program must be fully documented and laid out according to the CS271 Style Guide. This includes a complete header block for identification, description, etc., a comment outline to explain each section of code, and proper procedure headers/documentation.
Notes
For this program, you may use global variables instead of passing parameters in memory or on the stack. This is a one-time relaxation of the standards so that you can get accustomed to using procedures.
Extra Credit Options
Align the output columns (the first digit of each number on a row should match with the row above). (1pt)
Display 4000 primes, shown 20 rows of primes per page. The user can "Press any key to continue..." to view the next page. Since the length of the numbers will increase, it's OK to display fewer numbers per line. (2pt)