Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project 6, Program Design C Programming 1. (100 points) Write a program that prompts the user to enter the name of a file. The program

Project 6, Program Design C Programming

1. (100 points)

Write a program that prompts the user to enter the name of a file. The program (in C) finds the anagrams in the file.

Enter the file name: words.txt

Output: anagrams are written to file: words.txt.ang

The program reads the content of the file and stores the words in an array of strings,

the program then finds the anagrams and writes the anagrams to the output file.

1.Name your program fileIO.c.

The output file name should bethe same name as the input file but with an added extension of .ang.

In this example, the original file name is words.txt.

The output file name is then words.txt.ang.

Assume the file name is no more than 100 characters.

Assume the length of each line in the input file is no more than 100 characters.

Assume the input file contains no more than 1000 words.

2. The following function is provided in anagram.c:

int are_anagram (char *word1, char *word2);

word1 and word2 are strings containing the words to be checked for anagram. The function returns 1 if the two words are anagram . of each other and return 0 otherwise.

3. The output file should be in the following format. The output file contains all the anagrams.

1 inch

chin

2 roast beef

eat for BSE

...

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago