[Solved] CS570: Programming Foundations Assignment #5

$25

File Name: CS570__Programming_Foundations_Assignment__5.zip
File Size: 414.48 KB

SKU: [Solved] CS570: Programming Foundations Assignment #5 Category: Tag:
5/5 - (1 vote)

Program #1: Iterative (non-recursive) palindrome program. (50%)

A palindrome is a string of characters that reads the same forward or backward. For example, the following strings are palindromes:

  • radar
  • noon
  • able was I ere I saw elba

Note that some palindromes have an even number of characters, whereas others have an odd number of characters.

Write an iterative (non-recursive) program called PalidromeTester which tests whether a given string is a palindrome.

A sample interaction with PalindromeTester is shown below:

Enter a potential palindrome:

radar

That string IS a palindrome.

Test another palindrome (y/n)? y

Enter a potential palindrome:

abracadabra

That string is NOT a palindrome.

Test another palindrome (y/n)? y

Enter a potential palindrome:

able was I ere I saw elba

That string IS a palindrome.

Test another palindrome (y/n)? n

As a minimum your program should be able to correctly determine palindromes considering spaces, punctuation marks, and changes in uppercase and lower case. That is, your program will be considered correct if given the strings Radar and race car it outputs that they are NOT palindromes.

Program #2: Recursive palindrome program. (50%)

Re-implement the palindrome program using a recursive solution.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS570: Programming Foundations Assignment #5[Solved] CS570: Programming Foundations Assignment #5
$25