Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ ONLY!! I'm having a problem with my search function. When I type in a?? it returns the following: The word the appears 3 times

C++ ONLY!!

image text in transcribedimage text in transcribed

I'm having a problem with my search function. When I type in "a??" it returns the following:

"The word the appears 3 times in the document."

"The word and appears 7 times in the document."

I'm using the same sample.txt as in the prompt above.

Here's the portion in the main code related to this function:

image text in transcribed

Here's my search function:

image text in transcribed

Updates are highlighted CS101 Project 1 Spring 2018 Due date: 1/30 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 should store the distinct words in an array of strings. You can assume that there will not be more than 10,000 words in the file. You must supply a makefile that compiles your code to produce the projecti 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

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions