Question: For 50 points, write a program called Primel which reads an endless sequence of integers from stdin and tests whether each number is prime or

 For 50 points, write a program called Primel which reads an

For 50 points, write a program called Primel which reads an endless sequence of integers from stdin and tests whether each number is prime or not and prints a meaningful message to stdout if it is. Example program output is shown below Place all your code in "Prime1 cpp" including function "isprime int)" which is a boolean function that does all the checking. As usual, the endless input ends when CTRL-D is encountered. checking. As usual, the enmel cpp" including is, Example For 50 points, write a modified version of Primel called Prime2. Move the "isprime(int)" code into a class called "isprime" that overloads its function operator to act as a function object. Instantiate an "isprime" object in the main program and use it to test the input data. The program output is as shown below

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!