Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SAMPLE OUTPUT: exer_03 RAW CODE: #include #include #include #include #include using namespace std; #include #include string sort(string str);//reaaranging the orders of string to test if

image text in transcribed

image text in transcribed

image text in transcribed

SAMPLE OUTPUT: exer_03

image text in transcribed

image text in transcribed

RAW CODE:

#include #include #include #include #include using namespace std; #include #include string sort(string str);//reaaranging the orders of string to test if its anagram bool areAnagrams(string str1,string str2);//process the strgin if anagram anf returns the value 1 or 0 string RemSpacePunct(string str);//function that removes space and punctation in aa string //////////////////////////////// void palindrome(char sal[120]);//testing whether the c-string value is palindrome or not void password();//asking the user to enter the password char menu();//displaying choices a,b, and c then returns the answer void quit();//asking the user if he/she wants to quit string EnterPassword();//processing if the password is correct and diplaying it with "*" sign

int main() { char let,ans;

//add code here

switch(ans) {

//add code here

}

do{ cout>let; let=tolower(let); }while(let!='n'&&let!='y');

//add code here

system("pause"); return 0; }//end main

////////////////////////////////////////////////////// void quit() { //add code here

}

/////////////////////// string EnterPassword() { //add code here

return password; }

//////////////////////////////////////////////////// char menu() }

//add code here

return choice;

}

////////////////////////////////// void password() { //add code here }

//////////////////////////////////////////////////////////////// string sort(string str) { //add code here

} ////////////////////////////// bool areAnagrams(string str1,string str2) { //add code here } ////////////////////////////// string RemSpacePunct(string str) { //add code here } /////////////////////////////// void palindrome(char sal[120]) { //add code here }

Read the Direction(s) CAREFULLY. Exercise (100pts): C-String and String Class *******NOTE: Copy and paste the program below in your source file and you are required to add codes if necessary. You cannot OMIT given codes and/or function /No modification should be done in the given codes (main function and function prototypes). Otherwise, you will get deduction(s) from your laboratory exercise. Please be guided accordingly. PALINDROME is a word, phrase, number, or other sequence of characters which reads the same backward or forward. ANAGRAM is a word or a phrase made by transposing the letters of another word or phrase; for example, "parliament" is an anagram of "partial men," and "software" is an anagram of "swear oft" Write a program that figures out whether one string is an anagram of another string. The program should ignore white space and punctuation. #include #include #include #include #include using namespace std; #include #include string sort(string str);//reaaranging the orders of string to test if its anagram bool areAnagrams(string str1, string str2);//process the strgin if anagram anf returns the value 1 or 0 string RemSpacePunct(string str);//function that removes space and punctation in aa string MIMI void palindrome(char sal[120]);//testing whether the c-string value is palindrome or not void passwordO://asking the user to enter the password char menuO://displaying choices a,b, and then returns the answer void quit();//asking the user if he/she wants to quit string EnterPassword();//processing if the password is correct and diplaying it with "*"sign int main() { char let, ans; H //add code here switch(ans) { //add code here } doc cout>let; let=tolower(let); } while(let!='n'&&let!='Y'); //add code here system("pause"); return 0; }/end main void quit) { //add code here } string EnterPassword { //add code here return password; } char menu { //add code here return choice; } void password { //add code here } string sort(string str) { //add code here } bool areAnagrams(string str1, string str2) { //add code here } ///////////// string RemSpacePunct(string str) { //add code here } //////// void palindrome(char sal[120]) { //add code here } enter password: enter password: ****** sorry incorrect password.... you have reached the maximum attempt for password. Process exited after 136.6 seconds with return value 1 Press any key to continue If password is correct: [a] Check the palindrome [b] Testing if strings are Anagrams [c] Quit Your choice: [a] Check the palindrome Input the word: somebody in reverse order:ydobemos The word is not palindrome Do you want to try again [y] Choice

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions