Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem Description The first practical is intentionally made easy. The main objective is for you to get started on using SVN and the websubmission system.
Problem Description The first practical is intentionally made easy. The main objective is for you to get started on using SVN and the websubmission system. This practical will also test your knowledge of C-Strings, dynamic arrays, and pointers This assignment deals with strings. You are encouraged to try different implementation methods (e.g., try both std::string and C-string) A phrase is called a Palindrome if it is the same once reversed. Reversing "Race fast, safe car." gives us ".rac efas ,tsaf ecaR", which is actually the same as the original phrase if we ignore non-alphabetical characters and cases. Phrases like these are called Palindromes You are asked to create a Palindrome class that stores a phrase and supports three methods: removeNonLetters: remove all non-alphabetical characters from the phrase lowerCase: change all letters in the phrase into lower cases isPalindrome: return whether the phrase is a Palindrome You are asked to also create a main function. The main function takes as input a phrase (one line of characters, containing letters, spaces, digits, and punctuations). Hint: try getline) function Your main function should output whether the phrase is a Palindrome Sample input 1: Race fast, safe car Sample output 1: Yes Sample input 2: Bo1b Sample output 2: Yes Sample input 3: ADDS is furn Sample output 3: No Your submission should contain at least main.cpp Palindrome.cpp Palindrome.h design.pdf Your submission will be tested using the above sample test cases (as well as a few additional hidden test cases) g++ has too many versions, so being able to compile on your laptop does not guarantee that it compiles on the university system. You are responsible for checking, and if needed, debugging your code on a lab computer (or use SSH as described in remote access information in the first Module)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started