Homework laboratory exercise four is designed to strengthen your knowledge of functions, and introduce you to if...else... and while...
We are to prompt the user to enter a big number. The program must tell whether the number is in fact a valid integer, and then must find and print the number of digits in the number, as well as the sum of the digits of the number. We must also convert the number to an integer, and find out whether the integer is or is not a prime.
For example, if the user were to enter the number 12345, the program should respond by telling the user, "good job. You have entered a number." Number of digits is 5, sum of digits is 15. The number as an integer is 12345. The number is not prime.
On the other hand, if the user enters 12r345, the program must respond by telling the user that the input has an invalid character, and print the offending character.
You should gather the input as a string, then check each of the characters of the
string to determine if the character is a number. Thus, some functions that may be included in your code are:
Warning: Some of the functions required for this exercise are in the standard libraries. You *may not* use the library functions. I want you to write your own. Why? Because we can learn from doing.
As always, your laboratory report must include: