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 windows forms application to simulate coin tossing

Write down the Windows forms application which simulates coin tossing. Let program toss coin each time user press the toss button.

  Add a button control to the form to display the message box

Use three panels on a StatusBar control to display the current selections made by the user.

  Assignment on visual communication

Project teams from Stone Yamashita Partners (profiled in the chapter-opening "Communication Close-Up) look for new ways to connect and explore business ideas through creative

  Airline reservations system

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

  Create an application that stimulates the functionality

Create an application that stimulates the functionality of the gas pump. User enters the number of gallons to purchase and clicks the desired grade (each grade is represented by a Button whose Text properties are set to Regular, Special, and Super..

  Create web pages

What are some of the important features of these programs that assist a novice like Juan learn how to create web pages?

  Problem involving option buttons and radio buttons.

The Solution cannot be opened with Visual Basic 2010.

  Vv boards system

VV Boards System - To demonstrate completing and delivering a prototype RAD system using OOPs capabilities of VB.NET. CIS 3145 Business Application Development with Visual Basic

  Name the project and set the title of your form

Perform the appropriate steps to display the detail view of the fields on your form.

  Declare an array to store five values

Write the Visual Basic code to for the following problem. Declare an array to store five values; they could be decimal numbers

  Create a program to calculate deductible travel expenses

create a program to calculate deductible travel expenses for tax purpose. All the inputs except the arrival date and the departure date should be entered into the program via text boxes. The arrival date and the departure date are entered via maske..

  Create a clickonce local data source deployment

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

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