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

  Write the code to play a number guessing game

Write the code to play a number guessing game. Allow the user to select a lower and upper range to guess between. Ask the user how many guesses they want to guess the number. (Can be accomplished by a text box or a numeric up/down control).

  Modify the gate takings application

Your application from Activity 1 was able to keep a record of the total attendance and the total cash collected from ticket sales from all events happening at the Games.

  Create a vbscript program using notepad

In this lab, students will complete the following objectives. Create a VBScript program using NotePad++. Write a two-dimensional array of IP addresses to a text file

  Create a clickonce local data source deployment

The exit button should provide an exit Yes/No messagebox confirmation.

  To use the watch window to evaluate expressions

To use breakpoints to pause program execution and allow you to examine the values of variables. To set, disable and remove breakpoints

  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.

  Create a windows application that functions like a banking

Create a Windows application that functions like a banking account register. Separate the business logic from the presentation layer (create a class with all the methods and properties).

  Airline reservations system

Airline Reservations System - A small airline has just purchased a computer for its new automated reservations system.

  How to program in visual basic four square buttons

How to program in visual basic four square buttons arranged in a rectangular array each button says push me... when user clicks on a button the button disappears the other three come or remain visible

  Write a multiform program

Airplane Seating Chart An airplane has 15 rows (numbered 1 through 15), with six seats (labeled A, B, C, D, E, and F) in each row. Write a multiform program that keeps track of the seats that have been reserved and the type of meal requested by ea..

  Organize the code for user readability

Organize the code for reusability, Provide documentation with embedded comments for reader understanding

  Create a visual basic windows application

Create a Visual Basic Windows application. Use the following names for the solution, project, and form file, respectively: Georgetown Solution, Georgetown Project, and Main Form.vb. The interface allow the user to enter a five-digit credit card nu..

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