The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 3 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Two words or phrases in English are anagrams if their letters (and only their letters), rearranged, are the same. We assume that upper and lower case are indistinguishable, and punctuation and spaces don't count. Some examples and non-examples of regular anagrams:
Â
* The eyes / they see (yes)
* moo / mo (no)
* Clint Eastwood / Old west Action! (yes)
* Dormitory / Dirty Room (yes)
Â
Your job for this assignment is to solve a slight variant of the traditional anagram problem calledsuperanagram. Here you are to write a two class application that reads in two words or phrases from the keyboard, and then outputs true if the first phrase is an anagram ofsomeof the letters in the second phrase, false if it is not. Here are some examples:
Â
* mo / moo (true)
* mo / mOO (true - capitalization doesn't matter)
* moo / mo (false - first phrase is NOT an anagram of some (or all) of letters of second)
* rip / ziPPer (true)
* abc / aabc (true)
* aabc / abcde (false - too few a's in the second string)
* flipper / rip (false)
* Clint Eastwood / Old west Action! (true - the two can have exactly the same letters)
* a stitch in time saves nine / is this meant as an incentive? (true)
* narcissism / one man crisis (false- can you see why?)
Â
Example of a program run:
Enter a phrase: > Clint Eastwood Enter another phrase: >Old west Action! true
Â
Â
TEST CASES:
This file contains test cases to run your code on when you have it working. Most of the code has been written- you can finish implementing it and use it to fully test your SuperAnagram code. NOTE: do not submit this class to OWL. This is for your testing purposes only. If your code passes all of these tests your code is likely to get max points.
SuperAnagram Test Cases
Â
PROJECT REQUIREMENTS:
Â
Â
Some tips:
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly