Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C++ language Description For this project you will read words from a given file into your program. Each word consists strictly of the letters

IN C++ language

Description For this project you will read words from a given file into your program. Each word consists strictly of the letters A-Z and a-z. Any whitespace, punctuation, digit, etc. will separate words. An example would be this!is A&Word. This text would represent the 4 words this, is, A, and Word. Each word should be converted to lowercase so that only lowercase letters remain. Once you have read all of the words, you should output the total number of words read. Your next task is to determine how many distinct words appear in the file and output that value. Finally, you will prompt the user to enter a word and report how many occurrences of the given word are in the file. You will continue to prompt the user until they enter the word END in uppercase. When the user enters a word to search for, a ? character may be present as some of the letters for the search. This special character represents the ability to match any non-empty character. For example, foo? matches both "foot" and "food". This query should report every word that matches. Keep in mind that the ? character in the source input file is not a wildcard match. In the original source, it is just another non-letter character. Requirements Please carefully read the following requirements: You must supply a makefile that compiles your code to produce the project1 executable. You must use C++ streams for all I/O. You must format your output as shown in the example below. You must do your own work, you must not share code. You must submit your project in a zipfile as specified under submission.

Example Here is an example document sample.txt Cryptography is both the practice and study of the techniques used to communicate and/or store information or data privately and securely, without being intercepted by third parties. This can include processes such as encryption, hashing, and steganography. Until the modern era, cryptography almost exclusively referred to encryption, but now cryptography is a broad field with applications in many critical areas of our lives.

You must be able to run the program as shown below and get the identical output $ make g++ -Wall -std=c++11 main.c -o project1 $ ./project1 sample.txt The number of words found in the file was 64 The number of unique words found in the file was 52 Please enter a word: of The word of appears 2 times in the document Please enter a word: is The word is appears 2 times in the document Please enter a word: or The word or appears 2 times in the document Please enter a word: a?? The word and appears 4 times in the document Please enter a word: i? The word is appears 2 times in the document The word in appears 1 time in the document Please enter a word: END $

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

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions