Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the file strFuncs.cpp, write a function called isAnagram that takes two strings as arguments and returns a boolean true if the two strings are

In the file strFuncs.cpp, write a function called isAnagram that takes two strings as arguments and returns a boolean true if the two strings are anagrams, otherwise it returns false. The function should not be case sensitive and should disregard any punctuation or spaces. Two strings are anagrams if the letters can be rearranged to form each other. For example, Eleven plus two is an anagram of Twelve plus one. Each string contains one v, three es, two ls, etc. Similarly Rats and Mice and in cats dream are anagrams of each other. You may use any of the C string library or string class functions to complete this code. You may not use built-in C++ functions that we have NOT discussed in lecture. You must follow a TDD style of coding. Write your own test code in a separate file and write a Makefile to compile the code.

image text in transcribed

#include #include #include #include algorithm> #include "strFuncs.h" using namespace std; Precondition: Two valid strings s1 and s2, each containing a mix of alphabets, spaces and punctuations * Post condition: Return true if one string is an anagram of the other string. White spaces, punctuations and the case for the letters (upper or lower) should not * affect your result it bool isAnagram(string s1, string s2)0 return true

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_2

Step: 3

blur-text-image_3

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

Data Analytics Systems Engineering Cybersecurity Project Management

Authors: Christopher Greco

1st Edition

168392648X, 978-1683926481

More Books

Students also viewed these Databases questions

Question

Differentiate between product and process descriptions

Answered: 1 week ago

Question

Identify attitudes and values that will enhance your productivity.

Answered: 1 week ago

Question

understand the meaning of the terms discipline and grievance

Answered: 1 week ago