# PROG1205 Intro to Programming Lab 3 Prime Numbers - Loops

Availability: In stock

Regular Price: \$20.00

Special Price: \$15.00

OR

Double click on above image to view full picture

## Quick Overview

PROG1205 Intro to Programming Lab 3 Prime Numbers - Loops

Program Requirements
For this lab you will create a console application that will graphically display all the prime numbers up to a user entered limit. For more information on prime numbers, refer to the handout “Brief Notes on Prime Numbers” included with these instructions. This lab will provide you with the opportunity to design program logic with both individual and nested loops. It should also reinforce the time-saving value of planning before you code.

Getting User Input:
In the input phase of the program, display a program header and then prompt the user for the limit to the prime numbers they want displayed. This input must be a whole number between the range of 2 and 70 inclusive. Should the user enter something other than a valid, in range number, then display an appropriate message that describes the problem and give the user the opportunity to input the limit again.
Note that the TryParse() method should be used to determine if the user input is numeric and a whole number. Also, make sure that no processing occurs until the application has valid input.
The example below shows multiple invalid inputs; match this as closely as possible:

Final Output:
Once you have valid input, you will produce a list of prime numbers starting at 2, up to the limit the user entered. Start clearing the console window and with displaying a title as per the example below. In addition to displaying the prime number numerically, you will also display a “bar” of ‘X’ characters to represent the number. For example, the prime number 2 would be represented as “XX 2”.
The following output example shows what your program should produce if the user entered limit was 25; match this as closely as possible:

Regular Price: \$20.00

Special Price: \$15.00

## Details

PROG1205 Intro to Programming Lab 3 Prime Numbers - Loops

Program Requirements
For this lab you will create a console application that will graphically display all the prime numbers up to a user entered limit. For more information on prime numbers, refer to the handout “Brief Notes on Prime Numbers” included with these instructions. This lab will provide you with the opportunity to design program logic with both individual and nested loops. It should also reinforce the time-saving value of planning before you code.

Getting User Input:
In the input phase of the program, display a program header and then prompt the user for the limit to the prime numbers they want displayed. This input must be a whole number between the range of 2 and 70 inclusive. Should the user enter something other than a valid, in range number, then display an appropriate message that describes the problem and give the user the opportunity to input the limit again.
Note that the TryParse() method should be used to determine if the user input is numeric and a whole number. Also, make sure that no processing occurs until the application has valid input.
The example below shows multiple invalid inputs; match this as closely as possible:

Final Output:
Once you have valid input, you will produce a list of prime numbers starting at 2, up to the limit the user entered. Start clearing the console window and with displaying a title as per the example below. In addition to displaying the prime number numerically, you will also display a “bar” of ‘X’ characters to represent the number. For example, the prime number 2 would be represented as “XX 2”.
The following output example shows what your program should produce if the user entered limit was 25; match this as closely as possible:

## Product Tags

Use spaces to separate tags. Use single quotes (') for phrases.