Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSCI 1170 Open Lab Assignment #7(Optional) Program due: Monday April 30 (Lab will close on 4/25) Ola7 is optional. If you do all labs, lowest

image text in transcribed

image text in transcribed

CSCI 1170 Open Lab Assignment #7(Optional) Program due: Monday April 30 (Lab will close on 4/25) Ola7 is optional. If you do all labs, lowest score will be dropped. If you do not turn in ola7, ola7 score will be dropped. Assignment Overview This project focuses again on strings as well as introducing lists. Find the anagrams and print them The Problem An anagram, according to the wikipedia, is a type of word play, the result of rearranging the letters of a word or phrase to produce a new word or phrase, using all the original letters exactly once (http://en.wikipedia.org/wiki/Anagram) For example, the words canter, nectar, recant and trance are all anagrams of each other. That is, exactly the same letters are in each word but in a different order, and each ordering of the letters is a word in the English language You are going to write a program that reads from a word-list file (a file of words) and tries to find all the anagrams of the user typed word. Your goal is to find the list of words that are anagrams from a provided word-list Program Specifications 1. Your program will read word from a data file ("wordlist.txt") The word-list is formatted 2. 3. Output the anagram list cp SPUB/wordlist.txt wordlist.txt to have one word on each line For a user interactive input, find all anagrams (some words have more than one, as the above example showed) of that word. Assignment Notes: There are a couple of problems here. Think about each one before you start to program. How can I easily determine if two words are an anagram of each other? That is, what simple process can I apply to the words and, as a result, know if those words are anagrams? Note that the only characteristic that matters is what letters are in each word, irrespective of order. Is there an arrangement of the letters that would make the (Also, see the hint in note below!) 1. 2. Once I have such a process, how can I apply the process to all the words in the word-list and then find all the words with the same anagram

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

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions