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 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
Get step-by-step solutions from verified subject matter experts
