Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 4 Design a class named TextAnalyzer with features to analyze a text file. Your class should have the following member functions: Constructor : will

Lab 4

Design a class named TextAnalyzer with features to analyze a text file. Your class should have the following member functions:

Constructor: will receive a file name as a parameter and read its content. Set a status member variable to tell whether or not the file was uploaded successfully.

isUploaded: returns true if the file was uploaded successfully. This status is saved in a member variable that you defined in your class.

sentenceCounter: will return how many sentences there is in the text

wordCounter: will return how many words there is in the text

properNouns: will return how many potential proper nouns were found. Proper nouns start with a capital letter.

digitsCounter: will return how many digits were found in the text

Important: use the functions for character processing that you learned in Module 6.

Your class will need at least the following member variables:

A string to hold the text. You can choose either a string or c-string type variable. Note that c-strings will need to be allocated dynamically and will require you to define a destructor to deallocate that memory space.

A status variable to flag whether or not a file was uploaded to the object. All counter functions should check this status variable before proceeding to counting. Note that trying to count on an empty text may make your program crash.

Write a main program to test your class. You don't have to turn it in. Only turn in a .cpp or .h file with your class implementation. I will use it with my own main program. Note that you MUST follow the member function names that I listed because those are the names that I will call in my program.

please tell me what else is needed for this lab.

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions

Question

1. What are your creative strengths?

Answered: 1 week ago

Question

What metaphors might describe how we work together?

Answered: 1 week ago