Create the control instances on the form

Assignment Help Visual Basic Programming
Reference no: EM13935046

In this solution, you will 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. Figure (1) shows the completed form.

- Start VB .NET, and then create a new Windows Application project. Name the solution mech_Unit5.sln.

- 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 theread-only properties in the labels on the form.

Enhancements cannot replace required functionality and they must be more significant than changing the color of the form or the font of a control. Significant enhancements are primarily code-based as opposed to using the Properties Window.

Suggestions for enhancing this projects are: creating a procedure to loop through a String and count the number of characters, words, sentences and paragraphs and calling that procedure when required; creating a procedure to display the calculated values in the appropriate controls on the Form and calling that procedure when required; displaying the text of a file in the TextBox control AFTER the file has been processed; adding a Label control that shows the path to the file being processed.

Please note that these are only suggestions and are not requirements. You are free to use your imagination to enhance the application. Two significant enhancements are required.

The Form is already created and the class has also been created. It is attached bellow named "mech_Unit5.sln".

Attachment:- mech_Unit5.sln.zip

349_p.png

Reference no: EM13935046

Questions Cloud

Analysis of your own job and its context : Undertake an analysis of your own job and its context. If you do not have managerial (or similar) experience, or if for some other reason it is not appropriate to analyse your own job, you may choose instead the job of another individual (current ..
Expert system or other intelligent information system : Since the topics are general, try to choose topic that you are interested to be proposed for major project. Determine more specific system, e.g. a disaster notification through mobile application, learning mathematics with Kinect for kids, etc.
Types of diversity programs available to organisation : What contribution does a diverse workforce make to the effectiveness of the workplace? What are the different types of diversity programs available to organisations?
Software and design implementation in completion : Software and design implementation in completion of Phase 1 of the recipe management system, XYZZY management set up a focus group to evaluate the system. The group found that the current GUI design is confusing and that the insert functionality s..
Create the control instances on the form : Please note that these are only suggestions and are not requirements. You are free to use your imagination to enhance the application. Two significant enhancements are required.
Business issues involved in cross-cultural communication : The ability to identify the business issues involved in cross-cultural communication, and to present a set of persuasive recommendations (MBA-3M);
Implement for devices accessing the network via wireless : A client has asked you to provide details on the installation and configuration of a small business based wireless network. A plan of the client's business is provided below with the location of the phone line access point for the business.
What effect mutation have on g protein and effector protein : Siganl tansducing tirmeric G proteins consist of three subunits designated as alpha, beta, gamma. Suppose you have isolated a mutant G alpha subunit that has an increased GTPase activity. What effect would this mutation have on the G protein and t..
Example of a direct in-text reference : Which of the following is a correct example of a direct in-text reference? a) Practice refers to a process of going over activities before we are called on to perform them when it counts (Neck &Manz, cited in USQ 2014, p. 23).

Reviews

Write a Review

Visual Basic Programming Questions & Answers

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms". This assignment will contain two (2) Parts: Written Paper and Visual Basic Prototype. The Visual Basic Prototype is not included in the total page count but is included in the e..

  Visual basic programming discussion

The use of decision logic is one of the major concepts of computer programming. The decision takes your code from being sequential to one that can take various options based on the different conditions. Determine the method of coding that you would u..

  Ticketseller

Use Visual basic 2010Visual Basic,  TicketSeller. This assignment will contain two (2) Parts: Event Planning Document and Coding phase. You must submit both parts as separate files for the completion of this assignment. Remember, you are only to de..

  Data storage & "exception error trapping"

Discussion on Data Storage and  "Exception Error Trapping".

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms".

  The implementation of server side of the application

Implementation of dynamic content, server side (backend) and database for your web site using Microsoft Visual Studio 2012

  Need help building a vwd website

Need help building a VWD website. This website may not go live. I have little progress as a family tragedy has impeded my time for school.

  To develop a visual basic console application

The aim of the assessment is to develop a Visual Basic console application that performs a number of mathematical functions. The mathematics package will be menu driven, i.e. a number of options will be displayed, and the user will be able to input w..

  Program in basic which prompts user to input two integers

Write down the program by using Small Basic which prompts the user to input two integers: firstNum and secondNum (firstNum must be less than secondNum).

  Develop vb-net application that includes arrays and loops

Develop a VB.NET application that includes arrays, loops, and IF statements to do the following. Your output must also display the number of applicant(s) being interviewed.

  Visual basic program to accept numeral values

Write a VISUAL BASIC program to accept numeral values of any unit, sum up the total, calculate the average, and then Output the result with a proper unit.

  Write a visual logic program to accept series of number

Write a Visual Logic program which accepts a series of numbers, until the first negative value is entered. The maximum number of non-negative input values is 250.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd