Palindromes are CATchy!
- Create a function called is_palindrome which receives a string as a parameter and returns true if that string is a palindrome, false otherwise. Remember that a palindrome is a word that is the same forward or backward. For full points your function must ignore case and must work with any character (not just letters). So (“Dad$dad” is a palindrome even though the D is capital and d is lower case).
- Create a function called find_threes that receives as a parameter a list (or Vector or array for C++ students) of numbers and returns the sum of all numbers in that list that are evenly divisible by 3. Note if using vectors, you will need an additional parameter to represent the number of numbers in the array. So if the list was [0,4,2,6,9,8,3,12], the function would return 30 (0+6+9+3+12)
Ok, I just realized that Ken loves palindromes!! haha jk Ken, ok so basically is all explained there, we have to make a program to tell us if a word is a palindrome or not, and it doesn’t matter what characters does the word have, or capital or lower case , as long as it say the same backwards.
In class told us some tricks to make this quiz, and there were very helpful.
Here’s the code:
here’s the second part:
And as usual the code in GitHub
Quiz#5 by andreatrejod is licensed under a Creative Commons Attribution 4.0 International License.