A. The Robot Simulator
B. The PALINDROME PROBLEM
Programming: An individual assignment in 3 parts, not to be done in groups.
Once the robot_world simulator is running, use the half-dozen commands described in the manual to exercise the robot -- to get him (or her, if you wish) to move around, perhaps bump into a few walls, get recharged, pick up and move a toy, etc. NOTE: When prompted to indicate whether you will be using the simulator in USER mode or FILE mode, enter a 1 to indicate USER mode.
When you have checked out most of the capability of the robot simulator have the robot do the following before stopping him:
Be sure to thoroughly test your program -- carefully choose a set of test cases to test each possible execution path through the program. This will be a lot easier to do if the is_palindrome and is_prime steps are each implemented as separate functions.
NOTE: A palindrome is a number (in this case -- it could also be a word) that reads the same forwards as backwards). For example,
and
8720278
are palindromes.
Some example messages that your program might print:
For a value of p = 272, the program might print the messages
p is not prime p is a palindromeFor a value of p = -3, the program might print
p is not a valid input value and has been skippedFor a value of 37 the program might print
p is prime p is not a palindrome
Turn In: A data requirements table and structure chart (as illustrated in the Friedman/Koffman C++ text), and correct compilation and execution tests.
Turn In: The web page(s) you printed out.
Due Date: Tuesday, January 28, 1997 (in class).