Write a program that reads in two numbers from the keyboard.
(The program should ask the user to enter the numbers.)
(The two numbers are on separate lines. Let's assume the
first number is K and the second number is M.)
PART 1:
The program should store the following sentence in an array
of characters:
I LOVE COMPUTER SCIENE
The program should send the K-th letter of the sentence to the
screen M times.
For example, if the numbers are
K=3 and M=5 the program should send to the screen:
LLLLL
because L is the 3rd letter, and we asked to get it 5 times.
Your program should assume that the input will be numbers, but
it might contain "unreasonable numbers".
Thus, if the input is a negative number, it should give an error message.
If K is greater than 22, it should give an error message.
If M is greater than 80 or equal to 0 or negative, it should give
an error message.
All error messages should be polite and informative. NOT just:
Invalid Input.
PART 2:
As the last step, write a function ISPRIME with one integer
argument that returns TRUE if the argument is a prime number.
Then call this function from your main program with K and M
as arguments:
ISPRIME(K)
ISPRIME(M)
and print a friendly message informing the user that the number
K (M) is or is not a prime number.
## Deliverables
Please Comment all work done.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Must complie on UNIX with g++ or similar.