Components and Classes

Create a Class Library project that will count the number of characters, words, sentences, and paragraphs contained in a text file or a multi-line text box. You will also create a Windows Application to test the Class Library project you create. The Class Library project will have one class module. The class will have one method that will open a text file for input. The same method should also count the number of characters, words, sentences, and paragraphs in the file. Another method will perform the same task but use a multi-line text box. The developer should be able to read these values using read-only properties. The form will have an OpenFileDialog control instance to open a file as specified by the user. The Figure shows the completed form.

? Save and execute the file named Ch12Ex1.exe, (You will also need the file: Ch12Ex1ClassLibarary.dll) setting the drive designator as necessary. Click the Analyze File button. When the Open dialog box appears, select the name of a text file on your computer. Click Open. The number of characters, words, sentences, and paragraphs contained in the text file will appear on the form. Exit the solution.

? Start VB .NET, and then create a new Windows Application project.

? Add a Class Library project to the solution. Note that VB .NET will create an empty class mod- tile. Name the Class Library project Unit5ClassLibrary.

? Set the name of the class automatically created by VB .NET to StringProcessor.
? Set the root namespace to Course.

? In the Windows Application project add a reference to the Class Library project.
? In the class module, declare hidden variables to store the number of characters, words, sentences, and paragraphs.

? Create four read-only properties named Characters, Words, Sentences, and Paragraphs. These properties should return the number of characters, words, sentences, and paragraphs, respectively, stored in the corresponding hidden variables. Create Property Procedures rather than Public variables.

? Create a read-write property named StringContents, and a hidden variable to store the string. If the developer sets the property, calculate the number of characters, words, sentences, and paragraphs contained in the string, and then store the results in the hidden variables that you declared. Note: A word is a sequence of characters separated by a space. A sentence is terminated with a period, and a paragraph ends with a LineFeed character (Microsoft.VisualBasic.ControlChars.Lf). Your solution does not need to account for malformed sentences. For example, a paragraph that ends in something other than a sentence with a period.

? In the class module, create a method named OpenFile. This method should accept one argument – the full path name of the file to be opened. In the OpenFile method, write the necessary statements to open the text file, then count the number of characters, words, sentences, and paragraphs. As you will he reading a disk file, you will need to rise the StreamReader class to open and read the file.

? The process of determining what constitutes a word can be expanded. For example, in addition to having a space character separate a word, tab characters should also separate words. Add this feature to the OpenFile method and the StringContents property procedure.

? Create the control instances on the form as shown in the Figure.
? Write the code for the Analyze Text button. The code in this event handler should create an instance of the StringProcessor class. Set the StringContents property to the contents of the multiline text box. Assigning a value to the property causes the code you wrote in the Property Procedure to process the string, and set the values of the read-only properties. Store the value of the Characters, Words, Sentences, and Paragraphs properties in the output labels appearing on the form.

? Write the code for the Analyze File button. Use the OpenFileDialog control instance to get a file name from the user. Create an instance of the StringProcessor class. Call the OpenFile method to process the file. Finally, display the results from the read-only properties in the labels on the form.

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with AssignmentHelpWeb
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Business Studies
Thank you!
Customer 452451, November 27th, 2022
Theology
Job well done and completed in a timely fashioned!
Customer 452451, November 18th, 2022
Architecture, Building and Planning
The assignment was well written and the paper was delivered on time. I really enjoyed your services.
Customer 452441, September 23rd, 2022
Nursing
The paper was EXCELLENT. Thank you
Customer 452449, September 23rd, 2022
English 101
Very good job. I actually got an A
Customer 452443, September 25th, 2022
Anthropology
Excellent services will definitely come back
Customer 452441, September 23rd, 2022
Psychology
Thanks a lot the paper was excellent
Customer 452453, October 26th, 2022
Business Studies
Job well done. Finish paper faster than expected. Thank you!
Customer 452451, October 3rd, 2022
Anthropology
excellent loved the services
Customer 452443, September 23rd, 2022
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat