Question: C++ Concepts tested by this program : 1.Learn to organize code within a function 2.Learn to pass data to and return Boolean data from function

C++

Concepts tested by this program:

1.Learn to organize code within a function

2.Learn to pass data to and return Boolean data from function

3.Use of loop

4.Use file processing

Program Prime Numbers A prime number is an integer that is greater than 1 and that is only evenly divisible by itself and 1. For example, the number 5 is prime because it can only be evenly divided by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1, 2, 3, and 6.

Write a function name isPrime, which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Demonstrate the function in a complete program that reads in an integer that is less than 3001 stores a list of all the prime numbers from 2 through that number in a file named "PrimeList.txt" and to the standard output.

Screenshot:

Title, Prompts, Output, Labels:

Program will write output to the file and to the standard output.

1. A program writes the following text to the standard output(Can bee seen in the top of the screen shot):

CMSC 140 CRN Project 5: Prime Numbers

2. After closing the file, the program writes to the standard output:

a. on a line by itself :

Prime numbers are written to PrimeList.txt

b. a list of primes

Input Validation If the value read in exceeds 3000, the program writes on a line by itself in standard output:

Your input integer should be less than 3001. Try again.

Porgram should look something like this: In the images the user inserted 23 and the rest of the numbers came froma seperate .txt file that u have to make containing those numbers(pretty sure).

C++ Concepts tested by this program: 1.Learn to organize code within a

X CAUserslOwner Documents Visual Studio 20131Projects ConsoleApplication21\DebuglConsoleAp... CMSC 140 CRN xxxx Project 5: Prime Numbers *Written by a student Bill Morgan 04/03/2016 lould you please enter an integer number that should be less than 3001 23 2 19 23 Prime numbers written to PrimeList.txt Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!