PROG1205 Intro to Programming Lab 3 Prime Numbers – Loops

$ 20

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:

973 in stock

SKU: PROG1205LAB3PRIME Category:

Description

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:

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.