Question
C++ Tasks Compile and run the provided source code. Familiarize yourself with the flow of the provided code by entering valid and invalid inputs. What
C++
Tasks
Compile and run the provided source code. Familiarize yourself with the flow of the provided code by
entering valid and invalid inputs. What input values cause the code to return?
A prime number is a positive integer greater than or equal to 2 that is evenly divisible, that is no
remainder after division, by itself and 1 only. Write the prime number test algorithm using a For loop.
Make sure your For loop Breaks internally when a number is not prime.
Make sure your For loop runs fully when a number is prime.
Make sure your algorithm tracks primeness.
Make sure your algorithm has been fully tested.
Report the result of your primeness computation to the user.
Make sure your reported result is correct.
Make sure your menu still works.
Ensure your code complies with the following variable naming requirements:
Your Cin user input integer variable is named black.
Your For loop integer variable is named red.
Your primality tracking boolean variable is named blue.
Expected Output
=====PRIME TESTER===== input integer for testing: 2 2 is prime
input integer for testing: 4 4 is not prime
input integer for testing: 1 ====TRY AGAIN====
input integer for testing: 0 ====ALL DONE=====
#includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started